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