在进行窗体布局的时候,设置控件的位置和大小,大家可以在VS自动填充的代码中可以清晰的看到诸如这样的代码:

this.Label1.Location = new Point(12,5);

this.Label1.Size = new Point(34,13);

那么,同样的道理,我们可以利用窗体控件的Location和Size属性来获取控件在窗体上的位置坐标和大小值:

Point p = new Point();

p=this.Label1.Location;

Size s = new Size(this.Label1.Size);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2021-10-08
  • 2021-11-27
猜你喜欢
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-15
相关资源
相似解决方案