By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,961 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,961 IT Pros & Developers. It's quick & easy.

How to show an icon on a command button

P: n/a
At design time, I can set the button.image property to an icon and it
works fine. It must handle the conversion for me at this point.

I need to change the icon on the button during a MouseDown event. But
it won't let me because it says an Icon cannot be changed to an image.

How can I put an icon in the image property of a button at runtime?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Terry Olsen" <to******@hotmail.com> schrieb:
At design time, I can set the button.image property to an icon and it
works fine. It must handle the conversion for me at this point.

I need to change the icon on the button during a MouseDown event. But
it won't let me because it says an Icon cannot be changed to an image.

How can I put an icon in the image property of a button at runtime?


Use images (bitmaps, GIFs, JPEGs, PNGs) instead of icons. You can use an
'Icon' object's 'ToBitmap' method to create a bitmap from it.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.