p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   C# (http://p2p.wrox.com/forumdisplay.php?f=22)
-   -   Graphic disapeared (http://p2p.wrox.com/showthread.php?t=29775)

vnt May 25th, 2005 07:47 PM

Graphic disapeared
Hi all,

I have the following code:

private void DrawLine(int pNumber, string pLabel)
FontStyle Style = FontStyle.Regular;
Font Arial = new Font(new FontFamily("Arial"), 9, Style);
Graphics Graph = this.CreateGraphics();
SolidBrush Brush = new SolidBrush(Color.Blue);
Pen MyPen = new Pen(Color.LightBlue);

Graphics Graphics = this.CreateGraphics();
Graphics.DrawString(pLabel, lArial, Brush, mXOffset, mYOffSet + 2);
Graphics.DrawRectangle(MyPen, mXOffset, mYOffSet, mWidthText, mHeigh);
// ....

When use these to draw something in a Form. They are ok (visible)
but when i minimize and maximize, all graphics disapeared.

Why is that? is that b/c they are created in a local function?

Thank you

All times are GMT -4. The time now is 02:03 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.