1. 程式人生 > >ListView雙緩衝防閃爍

ListView雙緩衝防閃爍

public static void SetDoubleBuffering(System.Windows.Forms.Control control, bool value)
{
    System.Reflection.PropertyInfo controlProperty = typeof(System.Windows.Forms.Control)
        .GetProperty("DoubleBuffered", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
    controlProperty.SetValue(control, value, null);
}

呼叫

SetDoubleBuffering(listView1, true);