创建一个名为 Portrait() 并以纵向模式定位控件的新函数,并且将用于设置控件的 Location 和 Size 属性的代码从 InitializeComponent 复制到 Portrait() 中。
4.
使用该设计器以横向模式所需的布局重新定位控件。
5.
使用该设计器为横向模式生成的定位代码来重复执行步骤 3。
protected void Portrait()
{
this.crawlTime.Location = new System.Drawing.Point(88, 216);
this.crawlTime.Size = new System.Drawing.Size(136, 16);
this.crawlTimeLabel.Location = new System.Drawing.Point(10, 216);
this.crawlTimeLabel.Size = new System.Drawing.Size(64, 16);
this.crawlStartTime.Location = new System.Drawing.Point(88, 200);
this.crawlStartTime.Size = new System.Drawing.Size(136, 16);
this.crawlStartedLabel.Location = new System.Drawing.Point(10, 200);
this.crawlStartedLabel.Size = new System.Drawing.Size(64, 16);
this.light1.Location = new System.Drawing.Point(208, 66);
this.light1.Size = new System.Drawing.Size(16, 16);
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/