查询一个子窗体是否存在
//-----------------查询一个子窗体是否存在----------------
private bool checkChildFrmExist(string childFrmName)
{
foreach(Form childFrm in this.MdiChildren)
{
//用子窗体的Name进行判断,如果已经存在则将他激活
if(childFrm.Name == childFrmName)
{
if(childFrm.WindowState == FormWindowState.Minimized)
childFrm.WindowState = FormWindowState.Normal;
childFrm.Activate();
return true;
}
}
return false;
}
private bool checkChildFrmExist(string childFrmName)
{
foreach(Form childFrm in this.MdiChildren)
{
//用子窗体的Name进行判断,如果已经存在则将他激活
if(childFrm.Name == childFrmName)
{
if(childFrm.WindowState == FormWindowState.Minimized)
childFrm.WindowState = FormWindowState.Normal;
childFrm.Activate();
return true;
}
}
return false;
}
-----------------------------------------------------------------