
-----------------------------------
william 01
Tue Apr 19, 2011 1:01 pm

pics on buttons?
-----------------------------------
does any one know if its possible to put an image on a button, if so how?

-----------------------------------
z_cross_fire
Tue Apr 19, 2011 7:45 pm

RE:pics on buttons?
-----------------------------------
Yes. Use the 'Image' property of the button.

-----------------------------------
william 01
Thu Apr 21, 2011 12:52 pm

Re: pics on buttons?
-----------------------------------
can you post an example?

-----------------------------------
z_cross_fire
Fri Apr 22, 2011 11:37 pm

Re: pics on buttons?
-----------------------------------
Make a button;

http://img835.imageshack.us/img835/8581/89217286.png

Use its Image property;

http://img822.imageshack.us/img822/8586/36214258.png

And finally import an image, and click OK.
http://img580.imageshack.us/img580/3738/91397931.png

You can also use the "BackgroundImage" property for the button instead. You then have a choice to change the layout ("BackgroundImageLayout" property) for the background image ("StretchImage" works fine).

You might want to give this a read, if you prefer changing the image from code:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.backgroundimage.aspx

or this,
http://msdn.microsoft.com/en-us/library/system.windows.forms.buttonbase.image.aspx

Good Luck,
Z

-----------------------------------
william 01
Tue Apr 26, 2011 12:34 pm

Re: pics on buttons?
-----------------------------------
ok  :)  but, im trying to create a chess/checkers game so in need to be able to shift the images around, what i should have asked is if that is possable  :doh:




btw  :!: i am using 2008 so some of the stuff u can do i might not to be able to

-----------------------------------
Insectoid
Tue Apr 26, 2011 1:38 pm

RE:pics on buttons?
-----------------------------------
You should be able to do something along the lines of 'button1.image = some_image'. I dunno the specifics, but that's the idea. Check z_cross_fire's links.
