| CosminNTG (180) | |||
|
Hello! I have that program written in C#:
That program draws some lines and points (ellipses). The last method belongs to a button (I've created a button in design - mode and I double-clicked it). I want that, when I press that button, to earse all that was drawn on the screen. I know that I have a function Clear() that I can call from a Graphics variable, for instance g.Clear() but I can't do that because I've declared the Graphics variable in the previous function, so I can't use the g variable in that clear-button function. Thank you respectfully. | |||
|
|
|||
| webJose (2947) | |
| This is a C++ forum. For C# post questions @ MSDN: http://social.msdn.microsoft.com/Forums. There are specialized Windows Forms forums there. | |
|
|
|
| naraku9333 (919) | |
Why not make Graphics g a member of the class then just g = this.CreateGraphics() and g.Clear() in the respective functions.
| |
|
|
|
| CosminNTG (180) | |
|
I've got the idea. web Jose: sorry but I was in a hurry and I thought that might be someone around here specialized in C#. naraku9333: that worked. Thanks a lot. | |
|
|
|