Winforms: SuspendLayout/ResumeLayout is not enough?

We’ve seen this problem too. One way we’ve seen to “fix” it is to completely suspend drawing of the control until we’re ready to go. To accomplish this, we send the WM_SETREDRAW message to the control: // Note that WM_SetRedraw = 0XB // Suspend drawing. UnsafeSharedNativeMethods.SendMessage(handle, WindowMessages.WM_SETREDRAW, IntPtr.Zero, IntPtr.Zero); … // Resume drawing. UnsafeSharedNativeMethods.SendMessage(handle, WindowMessages.WM_SETREDRAW, … Read more

How do I double buffer a Panel?

You need to derive from Panel or PictureBox. There are ramifications to this depending on how you choose to enable the buffering. If you set the this.DoubleBuffer flag then you should be ok. If you manually update the styles then you have to paint the form yourself in WM_PAINT. If you really feel ambitious you … Read more

Winforms Double Buffering

This only has an effect on the form itself, not the child controls. If you have a lot of them then the time they need to take turns painting themselves becomes noticeable, it leaves a rectangular hole where the control goes that doesn’t get filled up until the child control gets it turn. What you’d … Read more