C#的label初始化

来源:百度知道 编辑:UC知道 时间:2024/05/29 10:48:47
我能让label移动,但是我想让他一开始就在最左边,label.left=this.with是在右边,但是是把属性right就是不行,怎么办

label.left=this.with及right不行。

应该用
label1.Location = new System.Drawing.Point(X,Y);

label1是要移动的 label

X,Y为以窗体左上角为原点的坐标,以像素为单位。

比如
label1.Location = new System.Drawing.Point(100,100);

这样,label1的左上角就移动到(100,100)了。