1. 设置FormBordStyle
2. 设置父窗体为Mdi容器,子窗体为其Child
3、使用如下方法打开窗体:
private void OpenForm(string formName)
{
foreach(Form f in this.MdiChildren)
{
if (f.GetType() == Type.GetType(formName))
{
f.Focus();
return;
}
}
Form frm = (Form)Activator.CreateInstance(Type.GetType(formName));
frm.MdiParent = this;
frm.Show();
}
2. 设置父窗体为Mdi容器,子窗体为其Child
3、使用如下方法打开窗体:
private void OpenForm(string formName)
{
foreach(Form f in this.MdiChildren)
{
if (f.GetType() == Type.GetType(formName))
{
f.Focus();
return;
}
}
Form frm = (Form)Activator.CreateInstance(Type.GetType(formName));
frm.MdiParent = this;
frm.Show();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货