How do I clear a panel from old drawing

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

I have a menu item Clear which should clear the panel from all drawing.
There is no controls existing in this Panel only lines.

I thought it should be easy to clear the Panel from old drawings but it
isn't
I have tried with this code
graphics.Clear(Color.FromArgb(255, 236, 233, 216));
but I get ArgumentException saying parameter invalid.

So how can I remove the old drawing and have the Panel as it is when I start
the program.

//Tony
 
Am 21.04.2011 19:43, schrieb Tony Johansson:
I have a menu item Clear which should clear the panel from all drawing.
There is no controls existing in this Panel only lines.

I thought it should be easy to clear the Panel from old drawings but it
isn't
I have tried with this code
graphics.Clear(Color.FromArgb(255, 236, 233, 216));
but I get ArgumentException saying parameter invalid.

So how can I remove the old drawing and have the Panel as it is when I start
the program.

//Tony

What about

dc.FillRectangle(Brushes.White, this.ClientRectangle);

E.S.
 
Back
Top