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 即可
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 即可
相关文章推荐
- 【转】Winform窗体显示在父窗体的中间位置几种代码
- winform中,如何控制控件位置随窗体的大小改变而改变
- Winform窗体显示在父窗体的中间位置几种代码 (转)
- winform中,如何控制控件位置随窗体的大小改变而改变
- WinForm中控件位置不随窗体大小的变化而改变
- C#窗体控件-分组框控件GroupBox
- 如何方便的保存WinForm窗体控件的位置大小等等配置信息
- winform 中用IrisSkin2 皮肤后,鼠标在窗体移动会有闪烁,GroupBox不停的闪烁 解决方法
- C# Winform 带优美外观的UserControl控件GroupBox
- winform中,如何控制控件位置随窗体的大小改变而改变
- C#如何在Panel或者GroupBox控件中自由地切换其他窗体
- C# Winform 如何获得窗体上控件相对于屏幕的位置
- c# winform groupbox动态添加控件(个人向。不喜勿喷)
- WinForm中窗体resize的时候对于控件位置的控制
- winform中,如何控制控件位置随窗体的大小改变而改变
- 在应用程序的GroupBox控件的OnMouseDown事件中加入如下响应函数,即可通过鼠标移动位置。
- winform 控件处在中间位置
- C#里WinForm开发中如何实现控件随窗体大小的改变而自动适应其改变
- C# WinForm窗体及其控件自适应各种屏幕分辨率
- c#GroupBox控件添加右键菜单