C#中子窗体最大化

1.设置父窗体属性;IsMdicontainer设置成true;

2.拖入button控件,修改button中的text。

 

3.点击button控件设置代码:

//1.窗体实例化
Form frm = new Form();
//2.设置所属父窗体
frm.MdiParent = this;

//3.显示子窗体
frm.Show();
//4.设置子窗体标题
frm.Text = "子窗体";

//5.设置窗体最大化

 frm.WindowState = FormWindowState.Maximized;

4.例题完成,最后效果如下:

 

猜你喜欢

转载自www.cnblogs.com/ljs7490/p/12452704.html
今日推荐