C# winform窗体抖动严重,怎么解决?
窗体,每次打开,都抖动严重,怎么解决?

解决方案 »

  1.   

    用了timer直接调用load事件刷新页面也可能引起抖动了,
      

  2.   

    是不是在FormLoad里频繁操作form上的控件了,可以试试先调用Form的suspendlayout()挂起布局,控件操作完了再恢复ResumeLayout()
      

  3.   

    C# WinForm窗体控件加载时闪动怎么解决?
    我加了下面的代码,还是没解决:
    this.DoubleBuffered = true;//设置本窗体
                SetStyle(ControlStyles.UserPaint, true);
                SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
                SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲整个窗体和控件都抖动闪烁厉害,好难看啊,实在受不了,用什么解决呢?
      

  4.   

    1、控件太多,开启DoubleBuffer
    2、莫非透明度在程序运行中有变动?
    3、莫非窗体大小位置在运行中有变动?
      

  5.   

    双缓冲 
     //双缓冲绘制,避免闪烁,窗体的构造方法中
                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);
            }
        }