Skip to content

Instantly share code, notes, and snippets.

@MatthewKing
Created March 20, 2014 05:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MatthewKing/9657697 to your computer and use it in GitHub Desktop.
Save MatthewKing/9657697 to your computer and use it in GitHub Desktop.
Double-buffering in WinForms using WS_EX_COMPOSITED
/// <summary>
/// A System.Windows.Forms.CreateParams that contains the required creation parameters
/// when the handle to the control is created.
/// </summary>
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x02000000; // WS_EX_COMPOSITED
return cp;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment