Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid screen flickering when showing form with user drawn controls?

So the transparent background problem is solved. Now, every time I show the form (or have to have it repainted), I get a lot of flickering. Is there any way I can not update the screen until the paint event is complete, or any other way to stop the 1/2 second of flickering and flashing while all the objects are being painted?

ANSWER: Double buffering is the way to go. I was already double buffering on the control, but it has to be set on the form. I though double buffering only worked when you were subclassing OnPaint yourself.

like image 778
user29140 Avatar asked Oct 20 '08 23:10

user29140


1 Answers

Did you try setting the DoubleBuffered property for the form?

like image 95
Gulzar Nazim Avatar answered Oct 05 '22 23:10

Gulzar Nazim