2
Answers

The drawing get erased on minimizing the form

iinf

iinf

13y
7.6k
1
Hi friends,

I am drawing several circles/recatangles etc. with this code but whenever I use to minimize the form of other form come on its front the drawings get erased.

            System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Red);
            System.Drawing.Graphics formGraphics = panelforImage.CreateGraphics();
            formGraphics.FillRectangle(myBrush, new Rectangle(0, 0, 200, 150));
            myBrush.Dispose();
            formGraphics.Dispose();

Please help me out.
Answers (2)