Question Convert string to brush

3Dmajid

New member
Joined
Feb 13, 2010
Messages
4
Location
IRAN
Programming Experience
Beginner
hi to all.
i am a newer in this forum.

i know that can convert string to system.drawing.color by FROMNAME method to use it in Pen variables, but how can to convert string to system.drawing.brush ?
because i want to use it in brush.
help me please. :D
 
You'll need to convert it to a color first then create a new SolidBrush of the color:
TheColor = Color.FromName("YourString")
MySolidBrush = New SolidBrush(TheColor)

Be sure to dispose of the SolidBrush manually.
 
Back
Top