如,在form1 中 用个按钮 show form2窗体,然后关闭form1,现在我想同样的操作,在form2中用个按钮show form1,然后关闭form2,怎么作呢?

解决方案 »

  1.   

    1,在FORM2的UNIT中引用FORM1的UNIT,注意方法,就不用说了;
    2,CLOSE,FROM1。SHOW不可以吗?
      

  2.   

    楼主,别这样了,
    还是听我的,登陆界面用panel吧
    方便很多的你怎么可以关了form再把他显示呢》?~~~
      

  3.   

    form2.show;
    postmessage(handle,WM_CLOSE,0,0);
      

  4.   

    if not asssigned(fomr2) then form2:=TForm2.create(nil);
    form2.show;
    postmessage(handle,WM_CLOSE,0,0);
      

  5.   

    Form1中:
      form2.show;
      self.close;Form2中:
      form1.show;
      self.close;
      

  6.   

    ADOQuery1.Close;
    ADOQuery1.SQL.Clear;
    ADOQuery1.SQL.Text:='insert into users (userID,userPWD) values ('''+str2+''','''+str3+''')';
    ADOQuery1.execsql;
         showmessage('注册成功,请重新登陆!');      form1.Show;
    //       Application.create(Tform1,form1);       用了出错[Error] friend.pas(72): Incompatible types: 'TComponent' and 'Class reference'
           self.Close;用了之后,form2是关闭了,form1 却没有打开。
      

  7.   

    如果你把原来的Form释放掉了,就不能简单的用Show来显示了,必须先给它分配内存,
    Form1:= TForm1.Create(Application);
      

  8.   

    我想你真正的问题可能是两个Unit间互相Uses未处理好.
      

  9.   

    是阿 ,应该 是你里面的处理关系 
    self.close ;
    最 好改成 form。close