Taking a VB .NET course that asked for me to create a gradient listbox, I created the brush like this:
Dim brGrad As New System.Drawing.Drawing2D.LinearGradientBrush( _
rct, _
Color.FromName(cboFromColor.Text), _
Color.FromName(cboToColor.Text), _
(CType(System.Enum.Parse( _
GetType(Drawing2D.LinearGradientMode), _
strGradient), Drawing2D.LinearGradientMode)))
They wrote it basically like this:
Dim brGrad As New System.Drawing.Drawing2D.LinearGradientBrush( _
rct, _
Color.FromName(cboFromColor.Text), _
Color.FromName(cboToColor.Text), _
(CType(System.Enum.Parse( _
GetType(Drawing2D.HatchStyle), _
strGradient), Drawing2D.LinearGradientMode)))
Both appear to give the same result. I am ASS U ME ing that that theirs worked because both are enumeratons in the drawing2 namespace that take the same type of argument.
How far off am I? Is mine the proper way to do it or did I miss something?