You know those color picker buttons with a little rectangle in it, displaying the currently selected color? Like in MS Office products.
I would like to implement one using C# / .NET. So I've got a nice little icon with a magenta-colored rectangle (which is to display the color) and a transparent background.
I can think of two ways how this could be done, but they're both not really elegant:
- Edit the icon using graphics software to have a solid background color instead of transparency and resize it to be exactly as large as the button containing it. This would allow to use TransparentColor=Manenta in combination with the button Background, however the icon would have to be edited whenever button size, toolbar BackColor or something else changes.
- Edit the icon programmatically whenever a new color is selected. Would work, but seems a little bit to complex (regarding development and performance) to me.
So. Maybe I am missing the obvious, easy way to implement such a button? Thanks in advance for any hints/suggestions/inspiration :)