窗体的构造函数中,开启窗体的双缓冲
public ssss()
{
//设置窗体的双缓冲
this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true);
this.UpdateStyles();
InitializeComponent();
//利用反射设置DataGridView的双缓冲
Type dgvType = this.dataGridView6.GetType(); //这里
PropertyInfo pi = dgvType.GetProperty("DoubleBuffered",
BindingFlags.Instance | BindingFlags.NonPublic);
pi.SetValue(this.dataGridView6, true, null); //和这里dataGridView6是你想要开启双缓冲的dataguidview
}