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

Changing the "Button.Picture property" at runtime 1

Status
Not open for further replies.

BaDi

Programmer
May 14, 2002
32
NL
Hi!

I Have a command button.
On the ON_CLICK event I want to change the picture of the button. How does this work?

Thanx in advance!
 
hi,


first set style property to Graphical (1)
and then use

<button name>.Picture = <picture path and name>

for eg.
if button name is command1 and picture is in root directory then

command1.Picture = &quot;c:\abc.ico&quot;


Bye




 
I had tried this allready. An error &quot;Type-missmatch&quot; occurs.

I hope that it is possible at all!!.. I don't get it!

Thanx anyway!

But any further help is more then welcome!
 
What extension does the picture file have that you are using? .bmp, .ico ?

Robert
 
Actually, what you need is:

Command1.Picture = LoadPicture(<your_image_file>)
 


yes strongm is right. I was probably feeling sleepy when i wrote

command1.Picture = &quot;c:\abc.ico&quot;
I must have wrote

command1.picture = loadpicute (&quot;c:\abc.ico&quot;)

Anyway, I will be more carefull for future posts




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top