Form1 frm = new Form1();
frm.TopLevel = false; //去掉form1的顶级界面
frm.FormBorderStyle = FormBorderStyle .None ; //去掉form1的边框
this.panel1.Controls.Add(frm);//加入控件
frm.Dock = DockStyle .Fill ; //最大化填充
frm.Visible =true ;//form1显示(不知道为什么会变成false) 原因 :.NET中,除了第一个窗体默认显示,其他的窗体在创建出来的时候都是VISIBLE=FALSE
在pannel或是groupbox中显示form的界面
最新推荐文章于 2023-08-29 17:15:00 发布