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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CommandButton picture property

Status
Not open for further replies.

tsm

Programmer
Nov 7, 2000
9
GR
I have a button with a picture in it. I set the picture property of the button and works ok. But sometimes i want to change this picture with another. That works but when i compile the program to .EXE when inside the program i change the picture property it displays nothing. Both picture are included at other files on project manager. how can i tell to the picture property to take the bmp from the project manager not from the disk. i want all bmps inside the .exe
 
It's been a while and I'm not certain but I believe that if you do not include the path but only "filename.bmp" it looks in the exe and current path... but I'm not certain of it. Good Luck

Pete
blindpete@mail.com

What your mother told you is true! You will go blind! (from moonshine anyway)
 
I tried without the path but the same thing.
 
Post the code that switches the picture property, perhaps it is some simple oversight...

Pete
blindpete@mail.com

What your mother told you is true! You will go blind! (from moonshine anyway)
 
I think that may be you have the .bmp in the proyect like "not included", you can see it but the .exe generation don't do.
Press the right buttom of the mouse over the object and select the option "include".
Note: May be you have the option name with other name, I have the spanish version, but take the idea.

I hop this help you

Dario
 
The bmp's is sure included in the project because if i right click in one of the bmp's i see the option exclude and not include. the code that i use is that :

IF !THIS.EditMode
THIS.btnAdd.Picture = "bmps\wznew.bmp"
THIS.btnEdit.Picture = "bmps\wzedit.bmp"
THIS.btnAdd.DownPicture = "bmps\wznew.bmp"
THIS.btnEdit.DownPicture = "bmps\wzedit.bmp"
ELSE
THIS.btnAdd.Picture = "bmps\wzsave.bmp"
THIS.btnEdit.Picture = "bmps\wzundo.bmp"
THIS.btnAdd.DownPicture = "bmps\wzsave.bmp"
THIS.btnEdit.DownPicture = "bmps\wzundo.bmp"
ENDIF

'bmps' is directory in the home of my project.
 
Try without refer to path, only write the name of the bmp


Dario
 
If i not include the path it happens the same thing.
 
Hmmm.... I'm stumped...
have you tried macro substitution?

this.downpicture = '&cBmpName'

I doubt it will make a difference but it is worth a go


Pete
blindpete@mail.com

What your mother told you is true! You will go blind! (from moonshine anyway)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top