Drawing on PictureBox

  • Thread starter Thread starter MuZZY
  • Start date Start date
M

MuZZY

Hi,

Just a quick question:
I draw a rectangle on the PictureBox:
pictureBox.CreateGraphics().Rectangle(rect);

When i minimize the form and restore again, i loose all i've drawn.
In what event handler i need to redraw the rectangle?

I tried to call the draw function in PictureBox.Paint - doesn't work.
I've tried also some other events, but can't find the one

Thank you,
Andrey
 
Protected Overrides Sub OnPaintBackground(ByVal pevent As
System.Windows.Forms.PaintEventArgs)
'do nothing. this will stop flicking due do background Drawing.
End Sub

regards
 
Back
Top