title: Clearing the graphics of a transparent panel C#
body: <p>I have a WebBrowser control with a transparent panel over the top of it, what I am trying to do is draw a rectangle on the transparent panel around the element in the page that the mouse is hovering over.</p>
  
  <p>So far I have everything working except the panel is not being cleared before drawing the next rectangle so I end up with rectangles everywhere.</p>
  
  <p>heres the code Im using.</p>
  
  <pre><code>paneGraphics = drawingPane.CreateGraphics();
  
  Rectangle inspectorRectangle;
  
  inspectorRectangle = controller.inspectElement();
  
  paneGraphics.DrawRectangle(new Pen(Color.Blue, 1), inspectorRectangle);     
  
  drawingPane.Invalidate();
  </code></pre>
  
  <p>I've tried using drawingPane.clear() but that just turns the screen white.</p>