解决方案
在该窗体的构造方法里补充:
this.DoubleBuffered = true; //设置本窗体
或者:
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲
为什么会闪烁?
对于大多数应用程序,.NET Framework 提供的默认双缓冲将提供最佳效果。默认情况下,标准 Windows 窗体控件是双缓冲的。可以通过两种方法对窗体和所创作的控件启用默认双缓冲。
参考文档:
Today's comments have reached the limit. If you want to comment, please wait until tomorrow (UTC-Time).
There is 04h28m58s left until you can comment.