You could try something like:
'Determine the font to use
Dim MyFont As New Font(Drawing.FontFamily.GenericSansSerif, 8.0F,
FontStyle.Bold, GraphicsUnit.Point, 0, False)
'Determine which color you are going to use
Dim MyColor As Color = Color.Black
'Create a brush based on the color
Dim MyBrush As New SolidBrush(MyColor)
'Draw the string
e.Graphics.DrawString("Test String", MyFont, MyBrush, 0, 0)
'Dispose of the brush object.
MyBrush.Dispose
'Dispose of the font object
MyFont.Dispose
With this method, you don't need to return the color from the brush since
you have already defined the color before creating the brush. You simply
access MyColor to determine which color the text was drawn in.
Hope this helps,
Jody
"JJ" <ja***@nospam.divemaster.org> wrote in message
news:h1********************************@4ax.com...
Hi all,
I am using the color dialog box to select a colour
to print with. However, the
e.Graphics.DrawString
method uses Brushes.Black, not Color.Black.
How do I convert from Brushes to Colors and back
again so that my program will run correctly?
Any help much appreciated,
Jason.