title: How to clear graphics on a transparent control in windows forms
body: <p>So, I am pretty unfamiliar with windows forms development.</p>
  
  <p>I'm trying to create a "hey I'm busy doing stuff" component that just spins a shape around. I want this control to be transient and draw on top of any other controls. The class inherits directly from Control.</p>
  
  <p>So I have this in the constructor:</p>
  
  <pre><code>SetStyle(ControlStyles.Opaque, true);
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>protected override CreateParams CreateParams
  {
      get
      {
          CreateParams parms = base.CreateParams;
          parms.ExStyle |= 0x20; 
          return parms;
      }
  }
  </code></pre>
  
  <p>Which gets me a control that will draw on top of other controls.</p>
  
  <p>Now my problem is this. I repaint the control a few times a second to give the appearane of a smooth animation. However, I can't figure out how to clear what was drawn in the previous frame. Using <code>e.Graphics.Clear(Color.Transparent)</code> in <code>OnPaint</code> turns the whole control black.</p>
  
  <p>Is there a way to just clear the drawn contents of a control?</p>
  
  <p>I've noticed that Resizing the the control will clear the background.</p>
  
  <p><strong>Things that Don't Work</strong></p>
  
  <ol>
  <li>Overriding OnPaintBackground to do nothing. Or just calling base.OnPaintBackground. Same results.</li>
  </ol>