您的位置:首页 > 其它

winform groupbox控件放到窗体中间位置

2015-01-26 15:04 363 查看
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 即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: