Skip to content

Instantly share code, notes, and snippets.

@pr8x
Last active May 30, 2018 17:04
Show Gist options
  • Save pr8x/2e464b3821eb30c71e1b9d9ae811f859 to your computer and use it in GitHub Desktop.
Save pr8x/2e464b3821eb30c71e1b9d9ae811f859 to your computer and use it in GitHub Desktop.
C#: reflection enable double buffering
public static void EnableDoubleBuffering<Control>(Control control)
where Control : System.Windows.Forms.Control
{
typeof(Control).InvokeMember("DoubleBuffered",
BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic,
null, control, new object[] { true });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment