Last post Apr 03, 2011 10:48 AM by kasemuga
Dec 19, 2006 07:47 AM|mike123|LINK
Can it be set to any color? Or just the ones that pop up on intellisense?
If I can change it to any color, how can I do that ?
Thanks very much!
Dec 19, 2006 03:40 PM|jose_jimenez|LINK
a brush is a base class. you can create a variety of brushes including one of a solid color of your choosing
see also lineargradientbrush, radialgradientbrush, texturebrush, etc.
Dec 20, 2006 02:54 AM|mike123|LINK
perfect, thats almost exactly what I am looking for. Do you know if it would be able to convert to a color using an input such as "#FFFFFF" and "#000000"
Thanks once again! much appreciated
Dec 20, 2006 09:05 AM|jose_jimenez|LINK
if you want FFFFFF that is equal to 255, 255, 255 (argb) because FF = 255. Convert your color from the hexidecimal to the decimal value and you can use the argb function.
here is a page that discusses a basic approach to the conversion
Dec 24, 2006 07:17 AM|surfer5|LINK
It would be easier to just use the ColorTranslator.FromHtml method if you are always using hex colors like #000000. Here is sample code how to use it in your code:
Brush testBrush = new SolidBrush(ColorTranslator.FromHtml("#000000"));
The good thing about this is that you could also use it with named values that work in HTML code. For example, the following would accomplish the same thing:
Brush testBrush = new SolidBrush(ColorTranslator.FromHtml("Black"));
Hope this helps.
Dec 25, 2006 06:03 PM|mike123|LINK
Apr 03, 2011 10:48 AM|kasemuga|LINK
Man its perfect rally thank you..