How to prevent DataGridView from flickering when scrolling horizontally?

前端 未结 4 739
闹比i
闹比i 2020-11-28 14:03

I am using windows forms C#.

\"Screen

As shown in the screen shot, I have a Form which has a use

4条回答
  •  情书的邮戳
    2020-11-28 14:23

    In your 'FormLoad' function just enter this line of code.

    yourDataGridView.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(yourDataGridView, true, null);
    

    and import BindingFlags by writing below line on top.

    using System.Reflection;
    

提交回复
热议问题