/// <summary>
/// 在主窗体中嵌套子窗体,主窗体中的 IsMdicontainer 设置成True;
/// </summary>
/// <param name="p">Panael</param>
/// <param name="F">子窗体</param>
private void AddForm(Panel p, Form F)
{
foreach (Control item in p.Controls)
{
if (item is Form)
{
((Form)item).Close();
}
}
F.MdiParent = this;
F.Parent = p;
F.FormBorderStyle = FormBorderStyle.None;
F.Show();
}