我已经查看了生成的Form
和UserControl
的设计器代码,在InitializeComponent()
方法中它们总是以以下内容开头:
I have looked at the generated designer code of
Form
s and UserControl
s, and in the InitializeComponent()
method they always start with this.SuspendLayout();
以...结束
this.ResumeLayout(false);
this.PerformLayout();
但从我在MSDN文档中看到的这些方法,似乎以此结尾不太对吧。
this.ResumeLayout(true); // Or just this.ResumeLayout()
要做完全相同的事情吗?还是我漏掉了什么?
我问这个问题是因为我将在不同的方法中添加大量控件,而认为我应该执行挂起-恢复程序以使其更加高效。但我无法弄清楚为什么需要这两个方法调用,当你似乎只需要使用一个方法调用...
ResumeLayout(true)
的意义,但它可能有其原因。 - Svish