简体   繁体   中英

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.

您是否尝试为表单设置DoubleBuffered属性?

Double Buffering might help, another thing you might want to try is:

SuspendLayout();

dostuffhere...

ResumeLayout();

在窗体上设置DoubleBuffered属性。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM