Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedded picture in a command button control 1

Status
Not open for further replies.

easycode

Programmer
Jan 28, 2005
195
US
Hello All,
I need to place a picture in a command button control and it works fine, but i would it to be embedded, so when i delete the file from the C drive (where the picture is) i will not get any error message.

cmdbutton.Picture = "C:\sortdes.bmp"

any suggestions is appreciated!

Thanks
 
When ever I want a "bipmap-buton" in access I create an image and raise it to look like a button, the image has most of the event that an action button has - mainly "OnClick".


Herman
Say no to macros
 
Thanks for your response
I just tried using the "bitmap-button ", but it also did not work it is happening the same thing it happens with the command button control, if i deleted the picture file in the C Drive, and run the application it will give me an error message saying that the files is no longer there.

If anyone can advice i'd appreciat it.
 
That solution should work. Deleting the file should have no effect if you embed it as Herman said.
 
It may be, because in the on click event i am calling to the bitmap.
I have a command button that represents ascendant sort and when the user clicks on it, it will change the picture to a descendant sort. Here is the code

Private Sub cmdsort1_Click()

If cmdsort1.Picture = "C:\sortdes.bmp" Then 'ascendant
cmdsort1.Picture = "C:\sortasc.bmp" 'descendant
Else
cmdsort1.Picture = "C:\sortdes.bmp"
End If

End Sub

Thanks again
 
The easy solution is to stack two buttons on top of each other

Private Sub cmdAsc_Click()
cmdDesc.Visible = True
cmdDesc.SetFocus
cmdAsc.Visible = False
'Your code here
End Sub

Private Sub cmdDesc_Click()
cmdAsc.Visible = True
cmdAsc.SetFocus
cmdDesc.Visible = False
'your code here
End Sub

Now you can embed the bitmap.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top