首页 > 技术文章 > c#控件重绘的问题

niuge 2015-05-26 16:12 原文

1.当Panel有背景图像的时候,往Panel添加控件(带图像),画面会非常闪烁,所以,Panel尽量不要带背景图像

2.带背景图像可以参考designer.cs里面的写法。。。

添加Control之前

           this.panelContainer.SuspendLayout();
            this.panelBTL.SuspendLayout();
            this.SuspendLayout();

    .............添加控件代码

 

            this.panelContainer.ResumeLayout(false);
            this.panelContainer.PerformLayout();
            this.panelBTL.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();

推荐阅读