SDKヘッダーファイルに次のようなWindowsスタイルがあります:WS_EX_COMPOSITED、このスタイルにより、Windowsフォームはすべてのフォームとその子コントロールでダブルバッファリングを有効にできます。
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x02000000;
return cp;
}
}
インターネットで言われていることは間違っています。
public Form1()
{
InitializeComponent();
base.SetStyle(
ControlStyles.OptimizedDoubleBuffer
| ControlStyles.ResizeRedraw
| ControlStyles.Selectable
| ControlStyles.AllPaintingInWmPaint // 禁止擦除背景.
| ControlStyles.UserPaint
| ControlStyles.SupportsTransparentBackColor
| ControlStyles.DoubleBuffer // 双缓冲
,true);
}