Go Premium for a chance to win a PS4. Enter to Win

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

ImageList TransparentColor

I make toolbar for Windows Forms application. ImageList for this toolbar has TransparentColor property. I want to draw each button background with this color. But I cannot find relation between these colors. TransparentColor property opens Colors dialog which has Custom, WEB and System tabs. Suppose I select LightGray color. How can I set bitmap background to the same color, I don't know it's RGB.
This is not programming question, just problem in using VS IDE.
0
AlexFM
Asked:
AlexFM
  • 2
  • 2
  • 2
  • +1
2 Solutions
 
JigitCommented:
AlexFM, I used Color.Teal with Toolbar.Appearance = ToolBarAppearance.Flat and it looks perfect.

HTH,
Jigit
0
 
AlexFMAuthor Commented:
Thanks, I need more information. How can I set Color.Teal for ImageList? Can I do this in Form Designer of in the code? How should I draw bitmap buttons to see nice Pushed effect?
Currently I have Color.Transparent and bitmap background white. Pushed (checked) buttons looks almost like normal buttons. I want to have light gray background in normal state and white background in pushed state. How can I do this - what properties should I use in ImageList, ToolBar and what colors should I use in button bitmaps?
0
 
Bob LearnedCommented:
The TransparentColor property for the ImageList is what color to make transparent for each of the images in the list.  So if you have LightGray, then any colors that have that RGB value in the image will be made transparent.

Is this what you are looking for or even talking about?

Bob
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
AlexFMAuthor Commented:
Well, what is LightGray?
0
 
Bob LearnedCommented:
   Debug.WriteLine(ColorTranslator.ToWin32(Color.LightGray))
    Debug.WriteLine(Hex(ColorTranslator.ToWin32(Color.LightGray)))

Bob
0
 
JigitCommented:
AlexFM, thanks for accepting my answer. Would you be so kind to feel feedback? (Just click on Feebdack link near the accepted answer)

Thanks in advance,
Jigit
0
 
jfchickimonCommented:
On the Custom tab, right click on one of the open colors on the bottom, and you can specify which color you want to be transparent, using RGB values.
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now