How do I clear a panel from old drawing

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
 
E

Ernst Sauer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top