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();
}

上一篇:mysql5.7主从复制配置——读写分离实现


下一篇:Servlet起步