B
Brian Henry
I am trying to draw a rectangle that sizes to the size of a user control...
which the user control is docked to the form... when i resize the form it
redraws but the old lines are still left on the screen makeing garbage
images and lines... how do you get the OnPaint event to draw correctly? this
is my code right now for it
Protected Overrides Sub OnPaint(ByVal e As
System.Windows.Forms.PaintEventArgs)
mybase.OnPaint(e)
e.Graphics.FillRectangle(New SolidBrush(Color.Red), Me.Top, Me.Left,
Me.Width, Me.Height)
e.Graphics.DrawRectangle(New Pen(Color.Gray), Me.Top, Me.Left, Me.Width -
10, 40)
End Sub
i tried moveing the base class call from the top to the bottom that made no
diffrence.. its a similar effect to drawing a line but not eraseing the
previous line while draging it... leaves the old lines in place.. thanks
which the user control is docked to the form... when i resize the form it
redraws but the old lines are still left on the screen makeing garbage
images and lines... how do you get the OnPaint event to draw correctly? this
is my code right now for it
Protected Overrides Sub OnPaint(ByVal e As
System.Windows.Forms.PaintEventArgs)
mybase.OnPaint(e)
e.Graphics.FillRectangle(New SolidBrush(Color.Red), Me.Top, Me.Left,
Me.Width, Me.Height)
e.Graphics.DrawRectangle(New Pen(Color.Gray), Me.Top, Me.Left, Me.Width -
10, 40)
End Sub
i tried moveing the base class call from the top to the bottom that made no
diffrence.. its a similar effect to drawing a line but not eraseing the
previous line while draging it... leaves the old lines in place.. thanks