Clearing the graphics of a transparent panel C#
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. 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. heres the code Im using. paneGraphics = drawingPane.CreateGraphics(); Rectangle inspectorRectangle; inspectorRectangle = controller.inspectElement(); paneGraphics.DrawRectangle(new Pen(Color.Blue, 1), inspectorRectangle); drawingPane.Invalidate(); I