Button Click -> to Paint handler??
-
I have a button that when clicked will draw a line on a Form. How do I pass to the Paint handler that the button was clicked to DrawLine, since I should do all my drawing inside the Paint handler? i.e... // btn_OK_Click { /// g.DrawLine(..... } // private void On_Paint { //btn_OK_Click ?? }
-
I have a button that when clicked will draw a line on a Form. How do I pass to the Paint handler that the button was clicked to DrawLine, since I should do all my drawing inside the Paint handler? i.e... // btn_OK_Click { /// g.DrawLine(..... } // private void On_Paint { //btn_OK_Click ?? }
You can use
Invalidate
method in the button click event handler which will repaint the window; so in the OnPaint you can put the code for drawing the line. Regards, Ashok Dhamija _____________________________ Padam Technologies