title: how to clear panel in a simple paint application
body: <p>I am working on a simple windows forms paint application. I am having problem in clearing the panel. The code i am using to draw is</p>
  
  <pre><code>private void panel1_Paint(object sender, PaintEventArgs e)
  {
      Graphics g = Graphics.FromImage(tempDraw);
      Pen myPen = new Pen(foreColor, lineWidth);
      g.DrawLine(myPen, x1, y1, x2, y2);
      myPen.Width = 100;
      myPen.Dispose();
      e.Graphics.DrawImageUnscaled(tempDraw, 0, 0);
      g.Dispose();
   }
  </code></pre>
  
  <p>How to clear the panel?</p>