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
Trevor
|