赞
踩
属性设置:
设置一个groupBox控件,让groupBox居中显示,里面是所有控件
- //当窗体登录的时候
- private void frmSOnOutLine_Load(object sender, EventArgs e)
- {
- //显示初始位置居中
- this.StartPosition = FormStartPosition.CenterScreen;
-
- //或者,位置坐标计算
- int gLeft = this.Width / 2 - grBOnOut.Width / 2;
- int gTop = this.Height / 2 - grBOnOut.Height / 2;
- grBOnOut.Location = new System.Drawing.Point(gLeft, gTop);
- }
设置属性
1、AutoSize属性设置为false
2、Dock属性设置为fill
3、TextAlgin属性属性设置为MiddleCenter(居中)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。