Drawing images on XP Style buttons

M

Max

I finally figured out how to enable XP style on VB .NET apps, but now
when I want a button to show an image it seems to disappear when the xp
style is enabled. Actually the image disappears whenever a button's
FlatStyle property is set to System which is what it has to be for XP
Style to work. So my question is, what's the best way of showing an
image on such a button. Preferably an image from an image list since I
need transparency.
 
H

Herfried K. Wagner [MVP]

* Max said:
I finally figured out how to enable XP style on VB .NET apps, but now
when I want a button to show an image it seems to disappear when the
xp style is enabled. Actually the image disappears whenever a button's
FlatStyle property is set to System which is what it has to be for XP
Style to work. So my question is, what's the best way of showing an
image on such a button. Preferably an image from an image list since I
need transparency.

<URL:http://www.codeproject.com/cs/miscctrl/xp-style_button.asp>
 
J

Jeff Johnson [MVP: VB]

I finally figured out how to enable XP style on VB .NET apps, but now
when I want a button to show an image it seems to disappear when the xp
style is enabled. Actually the image disappears whenever a button's
FlatStyle property is set to System which is what it has to be for XP
Style to work. So my question is, what's the best way of showing an
image on such a button. Preferably an image from an image list since I
need transparency.

You may need to put code in the Paint event for the button and draw the
image yourself with GDI+ methods. It's not the hardest thing in the world. I
just learned how to do it myself when I was looking to put a
downward-pointing arrow on a button, like "More v" (with the v representing
the arrow).
 

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

Similar Threads


Top