title: C# Draw Line OnPaint() vs CreateGraphics()
body: <p>Question:
  How do you properly draw on a winform from a method other than the OnPaint() method?</p>
  
  <p>Additional Information:
  The code I have now draws some background lines for a TicTacToe game in the OnPaint() method.  Then I use the Mouse_Click event and am running this code which apparently is not proper:</p>
  
  <pre><code>private void TicTacToe_MouseClick(object sender, MouseEventArgs e)
     Graphics g = this.CreateGraphics();
     g.DrawEllipse(this.penRed, this.Rectangle);
  </code></pre>
  
  <p>For reasons I do not understand, it does draw the circle, but when minimizing or moving the form off screen it erases the circles but not the lines from the OnPaint() method.</p>