How to avoid screen flickering when showing a form using custom controls?

So, the problem of transparent background is solved. Now, every time I show a shape (or need to recolor it), I get a lot of flicker. Is there a way I can not refresh the screen until the drawing process is complete, or is there any other way to stop 1/2 second blinking and blinking while all objects are drawn?

ANSWER . Double buffering is the way to go. I have already double-buffered the control, but it must be set on the form. Although double buffering only worked when you subclassed OnPaint yourself.

+7
c # winforms user-controls onpaint
source share
3 answers

Have you tried setting the DoubleBuffered property for the form?

+10
source share

Double buffering can help, another thing you can try:

SuspendLayout ();

dostuffhere ...

ResumeLayout ();

+5
source share

Set the DoubleBuffered property on the form.

+2
source share

All Articles