Suppress Paint Event
-
Hy, Can anyone tell me a way to supress the paint event in Windows Forms? I have on my form several controls and I don't want them to be redrawn when I maximize the form (for example). Thanks Do your best to be the best
-
Hy, Can anyone tell me a way to supress the paint event in Windows Forms? I have on my form several controls and I don't want them to be redrawn when I maximize the form (for example). Thanks Do your best to be the best
Any time the state of the window changes (maximize, minimize, move a mouse, drag a form across....) it invalidates the view since that view is no longer valid. If you suppressed the Paint event then your controls would disappear from the view by the vary nature of Invalidate(). I'm curious as to the logic behind not redrawing the controls...perhaps there is another route that keeps your controls visible.
-
Hy, Can anyone tell me a way to supress the paint event in Windows Forms? I have on my form several controls and I don't want them to be redrawn when I maximize the form (for example). Thanks Do your best to be the best
If you want to prevent the Paint event from firing (which is a very odd thing to do, btw), then you can override OnPaint and do not call the base implementation. The base impl fires the event. :josh: My WPF Blog[^]