Skip to content

Instantly share code, notes, and snippets.

@gszauer
Created June 6, 2013 00:34
Show Gist options
  • Save gszauer/5718459 to your computer and use it in GitHub Desktop.
Save gszauer/5718459 to your computer and use it in GitHub Desktop.
public static void SetDoubleBuffered(System.Windows.Forms.Control c) {
if (System.Windows.Forms.SystemInformation.TerminalServerSession)
return;
System.Reflection.PropertyInfo aProp =
typeof(System.Windows.Forms.Control).GetProperty(
"DoubleBuffered",
System.Reflection.BindingFlags.NonPublic |
System.Reflection.BindingFlags.Instance);
aProp.SetValue(c, true, null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment