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 即可
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 即可
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。