C#窗体嵌套

1.思路:在一个面板上显示或者隐藏不同窗体

private void button1_Click(object sender, EventArgs e)
{
chuangti at = new chuangti();
this.panel1.Controls.Clear();
at.TopLevel = false;
at.FormBorderStyle = FormBorderStyle.None;
this.panel1.Controls.Add(at);
at.Show();
}

private void button2_Click(object sender, EventArgs e)
{
chaungB b = new chaungB();
this.panel1.Controls.Clear();
b.TopLevel = false;
b.FormBorderStyle = FormBorderStyle.None;
this.panel1.Controls.Add(b);
b.Show();
}

C#窗体嵌套

上一篇:windows查看端口占用以及关闭相应的进程


下一篇:Passing the Message