Hy,
im trying to find the code to clear the graphics i drew in a panel.
Graphics gVenster = panel1.CreateGraphics(); -> is what I used to make the panel ready for graph.
private void wissen_MouseClick(object sender, MouseEventArgs e)
{
}
I tried to put panel.Clear(); gVenster.Clear(); between the curly braces. the only thing that doenst give me an error is tekenpanel.Dispose(); but then my whole panel is gone..
Please help me beceause this is part of een exam in school... I'm new in C# en managed to program a program like paint that works, this is the only thing that doens't work..
THanks in advance!!

1 answers
Try something like this:
Notice that gVenster needs to be a form level variable (i.e. a field), not a local variable, for this to work.
answered one year ago by:
17279