Drawing on PictureBox

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
 
S

Supra

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

regards
 

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.

Ask a Question

Top