Form2 ReportForm = null;..............
if(ReportForm  == null)
{
    ReportForm=new Form2();
}
    ReportForm.ShowDialog();

解决方案 »

  1.   

    private void OpenForm(string formName)
    {
    foreach(Form f in this.MdiChildren)
    {
    if (f.GetType() == Type.GetType(formName))
    {
    f.Focus();
    return;
    }
    }
    Form frm = (Form)Activator.CreateInstance(Type.GetType(formName));
    frm.MdiParent = this;
    frm.Show();
    }
      

  2.   

    private PsData psData = new PsData();........ 
            if (psData.Created)
    {
      /// 已经存在该窗口
      psData.Activate();
      psData.Location = new Point(0,0);
      psData.MdiParent = this;
      psData.Show();
     }
            else
    {
      /// 不存在或者已经被关闭,重新构建
      psData = new PsData();
      psData.MdiParent = this;
      psData.Show();
     }
    ...........
      

  3.   

    for(int i=0;i<this.MdiChildren.Length;i++)
    {
    if(this.m_frm==this.MdiChildren[i])
    {
    this.m_frm.Activate();
    return;
    }
    }this.m_frm= new ChildForm();
    this.m_frm.MdiParent = this;
    this.m_frm.Show();
      

  4.   

    最简单的方法,用ShowDialog()方法显示,就只能打开一个窗体,打开一次的话,你可以加一个计数器,<>0则菜单不可用