How to keep graphics when resizing C# form
<p>I am working on a program where I need to draw rectangle graphics onto the form itself, when I click the form. I created code to do this <em>(below)</em>, but when I resize the form the rectangles are deleted.</p>

<p>How do I retain the drawn rectangles when the form is resized?  </p>

<pre class="lang-cs prettyprint-override"><code>private void Form1_MouseClick(object sender, MouseEventArgs e)
{
    Graphics g = this.CreateGraphics();
    Pen Haitham = new Pen(Color.Silver, 2);
    g.FillRectangle(Haitham.Brush, new Rectangle(e.X, e.Y, 50, 50));
}
</code></pre>
