1、 在Form中放一个控件,让其在启动时始终居中

int gLeft = this.Width / 2 - groupControl1.Width / 2;

int gTop = this.Height / 2 - groupControl1.Height / 2;

groupControl1.Location = new Point(gLeft, gTop);、

 

2、在设计界面时,先把groupbox控件放到窗体中间位置,然后anchor属性 设置为none 即可

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-06
  • 2022-01-02
猜你喜欢
  • 2021-07-06
  • 2022-12-23
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
相关资源
相似解决方案