对窗体类: Form2 Obj = new Form2(); if (Obj.Created) {}对类: if (Obj.Equals(null)){}
建议使用showdialog,这样省去你检测窗口的麻烦。
业已搞定不知是否是笨了一点: int i=0; for ( ;i<this.MdiChildren.Length ;i++) { if ( this.MdiChildren[i] is SetEducationalLevel) { /*如查存在就设为活动窗口,显示*/ break; }} if (i>=i<this.MdiChildren.Length) { /*如果没有找到就生成一个*/ }
Form2 Obj = new Form2();
if (Obj.Created) {}对类:
if (Obj.Equals(null)){}
int i=0;
for ( ;i<this.MdiChildren.Length ;i++)
{
if ( this.MdiChildren[i] is SetEducationalLevel)
{
/*如查存在就设为活动窗口,显示*/
break;
}}
if (i>=i<this.MdiChildren.Length)
{
/*如果没有找到就生成一个*/
}
{
nRef ++;
}
每释放一个对象,就调用
static Release()
{
nRef --;
}需要时
if(nRef ==0 )
{}
else
{}