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!

How to assign an image from file to a button?

Status
Not open for further replies.

VladimirKim

Programmer
Jan 20, 2005
49
US
is is like:
btnPin.image.fromfile("pinhor.jpg")
and then, what property do I use to figure out what image is being used on the button currently?
Thanks
 
once you have set the image it is difficult to get the path of the image you used. but you could do this.

Code:
btnPin.image.fromfile("pinhor.jpg")
btnpin.tag = "pinhor.jpg"

this way you just use the tag to decide wich button has wich picture.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Ok, I understand tag thing. But the first line doesn't work, the button is blank, no picture on it. Maybe I'm assigning it wrong?
 
try using:
Code:
btnPin.Image = Image.FromFile("pinhor.jpg")



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top