帮忙看看问题

我写了个显示表单的函数
private void ShowSubWindow(string frmClassName,int mode)
{
bool b=false;
foreach(Form f in this.MdiChildren)
{
if(f.Name==frmClassName)
{
f.Activate();
b=true;
break;
}
}
if(!b)
{
object obj=ReflectionWindow(frmClassName);
Form frm =obj as Form;
if(frm!=null)
{
if(mode==0)
{
frm.MdiParent=this;
}
frm.Show();
}
}
}

ReflectionWindow函数是这么写的:
private object ReflectionWindow(string cName)
{
string path="工程名称";
string className=path+"."+cName;
object obj=Assembly.Load(path).CreateInstance(className);
return obj;
}

现在我调用这个函数来显示表单,传进表单名,对已经显示的表单不是激活,而是重新创建实例显示,跟踪到if(f.Name==frmClassName)这行,f.Name 全部是空。为什么,求助?

[851 byte] By [arthurwfc] at [2008-1-9]