C#winform窗体抖动严重,怎么解决
发布网友
发布时间:2022-05-01 03:40
我来回答
共1个回答
热心网友
时间:2022-06-24 03:01
双缓冲
//双缓冲绘制,避免闪烁,窗体的构造方法中
this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);
控件双缓冲
/// <summary>
/// tableLayoutPanel控件双缓冲,继承这个控件,再在这个控件的实例化时new这个类将其替换, ///this.tableLayoutPanel1 = new DoubleBufferTableLayoutPanel();
/// </summary>
public class DoubleBufferTableLayoutPanel : TableLayoutPanel
{
public DoubleBufferTableLayoutPanel()
{
SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint|ControlStyles.UserPaint, true);
}
}
试一下