2
當改變標籤的位置我有一個具有屬性我怎樣才能使用最大化窗口
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(554, 636);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(140, 155);
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
它在主要形式爲波紋管代碼添加label1的(示出1倍的值)
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
//this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
它運作良好。但是,如果我再添加一個代碼
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
我想自動標籤1的變化的位置,如它仍位於黃色區域。在C#中可能嗎?
您必須使用該控件的錨定。在屬性窗口中查找「Anchor」。 – Hemal