Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 pics on buttons?
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
william 01




PostPosted: Tue Apr 19, 2011 1:01 pm   Post subject: pics on buttons?

does any one know if its possible to put an image on a button, if so how?
Sponsor
Sponsor
Sponsor
sponsor
z_cross_fire




PostPosted: Tue Apr 19, 2011 7:45 pm   Post subject: RE:pics on buttons?

Yes. Use the 'Image' property of the button.
william 01




PostPosted: Thu Apr 21, 2011 12:52 pm   Post subject: Re: pics on buttons?

can you post an example?
z_cross_fire




PostPosted: Fri Apr 22, 2011 11:37 pm   Post subject: Re: pics on buttons?

Make a button;

Posted Image, might have been reduced in size. Click Image to view fullscreen.

Use its Image property;

Posted Image, might have been reduced in size. Click Image to view fullscreen.

And finally import an image, and click OK.
Posted Image, might have been reduced in size. Click Image to view fullscreen.

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




PostPosted: Tue Apr 26, 2011 12:34 pm   Post subject: Re: pics on buttons?

ok Smile 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 Exclamation i am using 2008 so some of the stuff u can do i might not to be able to
Insectoid




PostPosted: Tue Apr 26, 2011 1:38 pm   Post subject: 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.
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: