ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

Paul Kemper

DoubleBuffer any control

Source

public static void DoubleBuffered<T>(this T obj, bool isDoubleBuffered)
{
    Type dgvType = obj.GetType();
    PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.SetProperty);
    pi.SetValue(obj, isDoubleBuffered, null);
}

Example

this.DoubleBuffered(true);

Author: ?

Submitted on: 4 sep. 2014

Language: C#

Type: Generic

Views: 5394