在winform中怎样用代码改变button控件的上下位置
3个回答
展开全部
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
//这段是最大化以后,控件是怎么“停靠”的。
this.button1.Location = new System.Drawing.Point(12, 323); //控件坐标
this.button1.Name = "button1"; //不解释
this.button1.Size = new System.Drawing.Size(367, 23);//控件大小
this.button1.TabIndex = 1;
this.button1.Text = "按钮上的文字";
| System.Windows.Forms.AnchorStyles.Right)));
//这段是最大化以后,控件是怎么“停靠”的。
this.button1.Location = new System.Drawing.Point(12, 323); //控件坐标
this.button1.Name = "button1"; //不解释
this.button1.Size = new System.Drawing.Size(367, 23);//控件大小
this.button1.TabIndex = 1;
this.button1.Text = "按钮上的文字";
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询