子 窗体只能弹出一个,不能有它的第二个实例,
var childWin
function myCloseChildWin()
{
if (childWin != null)
{ if (! childWin.closed)
childWin.close();
}
}
function openWin(id)
{ if (childWin != null)
{ if (! childWin.closed)
childWin.close();
}
childWin=window.open("a.aspx");
}请参照 关于这个全部关闭 学习了
var childWin
function myCloseChildWin()
{
if (childWin != null)
{ if (! childWin.closed)
childWin.close();
}
}
function openWin(id)
{ if (childWin != null)
{ if (! childWin.closed)
childWin.close();
}
childWin=window.open("a.aspx");
}请参照 关于这个全部关闭 学习了
子窗体只有一个就使用单例模式。
f.Show();
public static Form GetForm(Type frmType)
{
foreach (Form item in Application.OpenForms)
{
if (item.GetType() == frmType)
return item;
}
}
在主窗体和子窗体之间来去自由。。啥意思 没看懂。子窗体只有一个实例 可以用单件模式 也可以用API FindWindows