//窗口双缓冲
this.SetStyle(ControlStyles.OptimizedDoubleBuffer //双缓冲
| ControlStyles.ResizeRedraw
| ControlStyles.AllPaintingInWmPaint, //不擦除背景,减少闪烁
true);
this.UpdateStyles();
//利用反射设置DgvResultInfo控件的双缓冲
Type dgvType = this.DgvResultInfo.GetType();
PropertyInfo pi = dgvType.GetProperty("DoubleBuffered",
BindingFlags.Instance | BindingFlags.NonPublic);
pi.SetValue(this.DgvResultInfo, true, null);
C#双缓冲防视觉闪烁
于 2024-11-27 14:37:18 首次发布