I’m trying to fill a rectangle with a gradient and give it a 1 pt stroke. I’m starting out with this:
Var linearBrush As New LinearGradientBrush
linearBrush.StartPoint = New Point(0, 0)
linearBrush.EndPoint = New Point(g.Width, g.Height)
linearBrush.GradientStops.Add(New Pair(0.0, &cCBBFB3))
linearBrush.GradientStops.Add(New Pair(0.4, &cA2968A))
Now, if I add this, I get the gradient:
g.Brush = linearBrush
g.FillRectangle(0, 0, g.Width, g.Height)
And if I add this, I get the stroke, but only if I comment out the code that gives me the gradient:
g.ForeColor = rgb(0, 0, 0)
g.penHeight = 2
g.penWidth = 2
g.DrawRectangle(0, 0, Me.Width, Me.Height)
Does anyone know what I’m doing wrong?
Thanks!