我的代码那里错了??关于子窗体不重复出现的代码

zjh135 2005-03-10 10:31:28
private void menuItem94_Click(object sender, System.EventArgs e)
{
for(int i=1;i<this.MdiChildren.Length;i++)
{
if(this.MdiChildren[i].Name=="PerDimission")
{
this.MdiChildren[i].BringToFront();
return;
}
}
PerDimission pd=new PerDimission();
pd.MdiParent=this;
pd.Show();

}//那里错了,PD窗体还是要重复出现呢??
...全文
64 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zjh135 2005-03-10
  • 打赏
  • 举报
回复
PerDimission 用在那里??
zjh135 2005-03-10
  • 打赏
  • 举报
回复
private static wantform;????
ffflyyy_470 2005-03-10
  • 打赏
  • 举报
回复
改:WantForm f=GetFormClass.GetForm();
ffflyyy_470 2005-03-10
  • 打赏
  • 举报
回复
class Form GetFormClass
{
private static wantform;
private GetForm(){}

public static Form GetForm()
{
if(wantForm==null)
wantForm=new WantForm();
return wantForm;
}
}

public void Click(...)
{
WantForm f=WantFormClass.GetForm();
f.MdiParent=this;
.....
}





111,086

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧