我有使用 tabPage 的 winform 应用程序,并且我在页面中动态添加了一些控件。然而,此后控件的位置发生了变化。经过一些调整,控件的位置似乎是正确的,但是某些控件的大小又不正确了。请帮忙!!!谢谢
像这样的代码片段:
foreach (Control c in controls)
{
Point oldLocation = c.Location;
this.SuspendLayout();
this.Controls.Add(c);
c.Location = oldLocation;
c.BringToFront();
this.ResumeLayout(false);
this.PerformLayout();
}