private void button1_Click(object sender, EventArgs e)
{
//如下向Panel添加一个带标题栏的窗体.
this.panel1.Controls.Clear();
Form2 f = new Form2();
f.TopLevel = false;
f.Visible = true;
f.FormBorderStyle = FormBorderStyle.None;
this.panel1.Controls.Add(f);
}
private void button2_Click(object sender, EventArgs e)
{
//如下向Panel添加一个不带标题栏的窗体.
this.panel1.Controls.Clear();
Form3 f = new Form3();
f.TopLevel = false;
f.Visible = true;
f.FormBorderStyle = FormBorderStyle.None;
this.panel1.Controls.Add(f);
}
一切搞定,共享给大家,应该对大家有帮助,能实现这样的功能应该可以做像优化大师那样的界面了
[此贴子已经被作者于2007-8-19 4:47:55编辑过]