Hi Tamir,
I do not think you want to prevent the paint event to happen.
The paint event occurs whenever some area of your form is invalid. If you
stopped paint event, the invalid area will not draw back, while it may
remain its being overlapped graphic.(For example, when you place a window
over your form, then move the window away, your form will not repaint, so
it being overlapped area will still remain the winodw's graphic. )
The right solution is store your paint DC and whenever the paint event
happens, redraw your invalid area. But most of these things have been done
by the windows, so you only need to focurs some few things. For example, if
you update some UI elements of WinForm, most of the time .Net Framework
will invoke the paint event(through invoke Invalidate method to achieve
this) for you, but some times, you need to explicit invoke the Invalidate
method to notify your form to repaint.
Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.