创建
这将是你所有孩子的根源
形式
,在你的
形式
.
方法,调用
控制
SuspendLayout()
;在
形式
OnResizeEnd()
控制
简历布局()
class MainForm: Form {
public MainForm()
{
this.Build();
}
void Build()
{
this.root = new Panel { Dock = DockStyle.Fill };
// create all controls and add them to root
this.Controls.Add( root );
this.ResizeBegin += (obj, args) => this.OnResizeBegin();
this.ResizeEnd += (obj, args) => this.OnResizeEnd();
}
void OnResizeBegin()
{
this.root.SuspendLayout();
}
void OnResizeEnd()
{
this.root.ResumeLayout( true );
}
Panel root;
}
希望这有帮助。