Skip to content

Instantly share code, notes, and snippets.

@drewchapin
Created December 12, 2017 02:36
Show Gist options
  • Save drewchapin/2135072d59a2125d9bc4ee843a7c94ad to your computer and use it in GitHub Desktop.
Save drewchapin/2135072d59a2125d9bc4ee843a7c94ad to your computer and use it in GitHub Desktop.
Turns on or off double buffering for controls that do not expose the property.
/// <summary>
/// Turns on or off double buffering for controls that do not expose the property.
/// </summary>
public static void DoubleBuffered( this Control control, bool value )
{
Type type = control.GetType();
PropertyInfo info = type.GetProperty("DoubleBuffered",BindingFlags.Instance|BindingFlags.NonPublic);
info.SetValue(control,value,null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment