Why does the DoubleBuffered property default to false on a DataGridView and why is it protected?

后端 未结 4 426
失恋的感觉
失恋的感觉 2020-12-31 04:46

We had a performance issue with DataGridViews where the redraw was horridly slow and found the solution Here to create a derived type and enable double buffering on the cont

4条回答
  •  星月不相逢
    2020-12-31 05:23

    I think its best solution:

    typeof(DataGridView).InvokeMember(
       "DoubleBuffered", 
       BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty,
       null, 
       myDataGridViewObject, 
       new object[] { true });
    

    found here

提交回复
热议问题