在这里插入代码片
private void label1_Click(object sender, EventArgs e)
{
foreach (Control item in this.panel2.Controls)
{
if (item is Form)
{
Form form = (Form)item;
form.Close();
this.panel2.Controls.Remove(form);
}
}
Form2 myform = new Form2();
myform.TopLevel = false;//取消非顶级窗体
myform.WindowState = FormWindowState.Maximized;//将窗体最大化
myform.FormBorderStyle = FormBorderStyle.None;//设为无边框
myform.Parent = this.panel2;//指定该窗体的父窗体
myform.Show();//展示窗体
}
09-30
09-30