MDI设置父子窗体

1.新建父窗体,设置窗体属性:IsMdicontainer设置成true;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

 

 

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

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

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

 

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

 

 

2020-03-08 这是我写C#例题的第一天。

posted @ 2020-03-08 23:51  winnerljs  阅读(1200)  评论(0编辑  收藏  举报