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刪除。