Last active
May 30, 2018 17:04
-
-
Save pr8x/2e464b3821eb30c71e1b9d9ae811f859 to your computer and use it in GitHub Desktop.
C#: reflection enable double buffering
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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