It depends. If you assigned an image to the Image property, assign
Nothing. If you paint anything in the Paint event (/onpaint), call
picture1.invalidate and stop painting in the paint event.
You can use the 'Clear' method of your 'Graphics' object.
\\\
Private m_Clear As Boolean
Public Sub OnPaint(ByVal e As PaintEventArgs)
If m_Clear Then
e.Graphics.Clear(Me.BackColor)
Else
e.Graphics.*
End If
End Sub
Private Sub Clear()
m_Clear = True
Me.Invalidate()
End Sub
Private Sub DrawAgain()
m_Clear = False
Me.Invalidate()
End Sub
///
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.