Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

Make image background on button transparent

See my screenshot:  

http://www.knowltonsoftware.com/junk/trans.gif


I want to make the white background the transparent color so the button shows through
0
Tom Knowlton
Asked:
Tom Knowlton
  • 7
  • 5
1 Solution
 
AaronReamsCommented:
Hi knowlton,

1) Add an image list your form
2) Add the image to the image list
3) Set the transparent color to whatever you want (white in your case)
4) Set the buttons imagelist to that imagelist
5) Set the index of the image in the imagelist in button's properties.

That's it!


Regards -A.R
0
 
Tom KnowltonWeb developerAuthor Commented:
Will this support TOGGLING between TWO IMAGES?
0
 
AaronReamsCommented:
If you want to toggle between two images...  Add two images to the imagelist and then set the button's image index property accordingly.

Cheers -A
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Tom KnowltonWeb developerAuthor Commented:
Gotcha!

Working.....coming along very fast....I think I get it......
0
 
Tom KnowltonWeb developerAuthor Commented:
0
 
Tom KnowltonWeb developerAuthor Commented:
Okay Aaron:

The Image assignment from the ImageList to the Button at runtime is working fine....as is the Image Toggling.

BUT

The image background is still NOT transparent....still showing up white......

I am missing something dumb here I am sure.......
0
 
AaronReamsCommented:
Hmmmm.  Strange.  

Are you sure you're using bitmaps and not icons?  
Are you sure the transparent color is set to the exact same color as your desired color?

I just tested this and getting transparent images to work can be a little quirky.  Make sure you have the TransparentColor property set to the color you want before you add the images to the image list.

Hope this helps. -A
0
 
Tom KnowltonWeb developerAuthor Commented:
>>>>>
I just tested this and getting transparent images to work can be a little quirky.  Make sure you have the TransparentColor property set to the color you want before you add the images to the image list.




That was it.............geeez..........I would call that a BUG.........LOL......
0
 
Tom KnowltonWeb developerAuthor Commented:
0
 
AaronReamsCommented:
Yeah, I would think that's a bug also.  

Right off hand, I'm not sure about your other question... sorry.  I'll try take a closer look at it if I get a chance later in the day.  

Good luck -A
0
 
Tom KnowltonWeb developerAuthor Commented:
Thanks Aaron!!!!   You do good work in this TA.....I always appreciate your help!!!
0
 
AaronReamsCommented:
Thanks knowlton!  Always glad to help.  -A.R
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now