Is there another way to persist a drawing other than from the Paint Event?

fsuorange2

Member
Joined
Jul 10, 2004
Messages
12
Hello,

I am creating a grid control and I would like a rectangle to be drawn on the screen from the Click Event of the control. So I made the following code to draw on my control from the click event:

Code:
dim g as graphics = me.creategraphics

However when I run my app and resize the form that the control is on, the rectangle that was drawn on the clicked control is erased.

My question is can I draw something on my control from within the click event or any other event or does it have to be in the paint event. Is there no other way. What do people do if they have a button and they want something only to be drawn when it is clicked?

Thanks in advance for your help!
 
Back
Top