Hi all,
I can draw a rectangle and fill with the code below:
before drawing another one at a different location how do
I restore the orginal color at the location?
Public Sub DrawRectangle(ByVal StartWidth As Single, ByVal StartHeight As
Single, ByVal Width As Single, _
ByVal Height As Single, ByVal FillColor As Color)
'Draw a regular rectangle
Dim NewBrush As SolidBrush
Dim NewRect As RectangleF
Try
NewRect = New RectangleF
With NewRect
.X = StartWidth
.Y = StartHeight
.Width = Width
.Height = Height
End With
NewBrush = New SolidBrush(FillColor)
NewGraphics.FillRectangle(NewBrush, NewRect)
NewBrush.Dispose()
NewBrush = Nothing
Catch ex As Exception
Throw ex
End Try
End Sub
thanks
Gerry
Morten Wennevik - 30 Apr 2005 08:48 GMT
Hi gv,
Draw the same rectangle with the original color, or call Invalidate(Rectangle)
> Hi all,
>
[quoted text clipped - 33 lines]
> thanks
> Gerry

Signature
Happy coding!
Morten Wennevik [C# MVP]