Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding an Image w/Transparent Background to a Button

Status
Not open for further replies.

rickj65

Programmer
Jun 5, 2002
79
0
0
US
I would like to have a command button displays both an icon and text on it. For example, a rectangular print button would have a printer icon and the word Print next to it.

I can create the bitmap image of the printer and the word "Print" easily enough in MS Paint, but the problem is that I can't get the image to appear on the button transparently (like typical Windows icons). I always get the background color (in this case white). I realize I can make the background the color of the button, but this does not account for when users have a different Windows button color scheme (say purple) than the one that the application was developed on.

Does anybody know how to accomplish this? Are icons the only objects that provide this kind of transparency?

Thanks,

Rick
 
rick,
In design view of your form, select "insert", "picture" import the image. Size it to the dimensions that you want. Create a command button and place it on top of the image. Size it to fit the image, select "transparent", "YES" from the "properties sheet"
jim
 
Jim,

Ideally I guess I'd like the icon to be created with transparency (I probably need to use Photo Shop or something), but your suggestion worked like a charm and I'll be using it.

Thanks!

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top