C#winform窗体抖动严重,怎么解决
1个回答
2017-03-16
展开全部
双缓冲
//双缓冲绘制,避免闪烁,窗体的构造方法中
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);
}
}
试一下
//双缓冲绘制,避免闪烁,窗体的构造方法中
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);
}
}
试一下
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询