Created
March 24, 2018 11:03
-
-
Save andylshort/e9e75364eec45f2289bba63d53f9e98a to your computer and use it in GitHub Desktop.
Force double buffering on any WinForms control
This file contains hidden or 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 DoubleBuffering(this Control control, bool enable) | |
{ | |
var method = typeof(Control).GetMethod("SetStyle", BindingFlags.Instance | BindingFlags.NonPublic); | |
method.Invoke(control, new object[] { ControlStyles.OptimizedDoubleBuffer, enable }); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment