MDI窗体,验证子窗体是否已打开
/// <summary>
/// 窗体是否已打开
/// </summary>
/// <param name="type">Form类型</param>
/// <returns>窗体, null</returns>
private Form FindChildRenForm(Type type)
{
Form frm = null;
foreach(Form f in this.MdiChildren)
{
if ( f.GetType() == type )
{
frm = f;
if ( frm.WindowState != FormWindowState.Maximized )
frm.WindowState = FormWindowState.Maximized;
frm.Activate();
break;
}
}
return frm;
}
/// 窗体是否已打开
/// </summary>
/// <param name="type">Form类型</param>
/// <returns>窗体, null</returns>
private Form FindChildRenForm(Type type)
{
Form frm = null;
foreach(Form f in this.MdiChildren)
{
if ( f.GetType() == type )
{
frm = f;
if ( frm.WindowState != FormWindowState.Maximized )
frm.WindowState = FormWindowState.Maximized;
frm.Activate();
break;
}
}
return frm;
}