如果该form已经打开,再点击按钮时,就把该form激活,而不是重新打开一个新的窗口~~~
该怎么实现呢?多谢~~

解决方案 »

  1.   

    http://community.csdn.net/Expert/topicview.asp?id=3922454
    http://community.csdn.net/Expert/topic/3922/3922454.xml?temp=.4582483
      

  2.   

    需要的时候enabled就true,不需要的时候就false.不就可以了吗
      

  3.   

    public static bool IsFrmXXXXIsOpen;
      

  4.   

    private Form2 f=null;
    private void button1_Click(object sender, System.EventArgs e) {
    if (f==null || f.IsDisposed ) {
    f=new Form2(); 
    }
    f.Show(); 
     }
      

  5.   

    private Form2 f=null;
    private void button1_Click(object sender, System.EventArgs e) {
    if (f!=null&&f.Visible) {
    f.Visible =true;
    }
    else
    {
    f=new Form2(); 
    }
    f.Show(); 
     }