How to show an icon on a command button

  • Thread starter Thread starter Terry Olsen
  • Start date Start date
T

Terry Olsen

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?
 
Terry Olsen said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top