Last post Jun 22, 2007 10:51 AM by ps2goat
Jun 22, 2007 09:55 AM|mike123|LINK
Currently in my code I set my brush color by going
fontColor = Brushes.Red
Is there a way I can set the color from a font color code such as #d2d2d2 ?
Thanks very much!
Jun 22, 2007 10:51 AM|ps2goat|LINK
If you use a SolidBrush, you can declare your own color. (SolidBrush inherits the Brush class, so the SolidBrushes can be treated as Brushes)
Use the ColorTranslator class to create a color from hex code.
' Imports at the top of the page
Dim myBrush As New SolidBrush(ColorTranslator.FromHtml("#d2d2d2"))
' use the solid brush as normal.