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

Re: Drawing on PictureBox by Supra

Supra
Mon Sep 06 03:28:21 CDT 2004

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

regards

MuZZY wrote:

> 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


Re: Drawing on PictureBox by Bob

Bob
Mon Sep 06 03:58:55 CDT 2004

I refer you to the #1 GDI+ FAQ question.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml






"MuZZY" <leyandrew@yahoo.com> wrote in message
news:JMT_c.384049$%_6.142537@attbi_s01...
> 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



Re: Drawing on PictureBox by MuZZY

MuZZY
Mon Sep 06 22:21:02 CDT 2004

Bob Powell [MVP] wrote:

> I refer you to the #1 GDI+ FAQ question.
>

Thanks, i got the idea!