就是在第一个表单中单击一个按键后,可以弹出第二个表单,若第二个表单不关闭的情况下,无法选取第一个表单。不知道,这是不是叫“父子表单”?谢谢。

解决方案 »

  1.   

    第二个表单为模态就行
    第一个表单的: 
       implementation
          uses unit2;            procedure Tform1.button1click(sender:Tobject);
     begin
         form2:=Tform2.create(self);
          try
                 form2.showmodal;
          finally
               freeandnil(form2);
            end;
     end;
      

  2.   

    chinaandys:你好!我在form2中要进行查询的,并将查询结果返回在form1中显示,若用showmodal,就无法操作了,请问这个情况下,程序应该怎么写啊?
      

  3.   

    若第二个表单不关闭的情况下,无法选取第一个表单。
    --------------------------------------------------
    如果不用模式
    if not assign(form2) then其实我不懂你的意思
    摸在Form2查询后,继续在这里操作Form1就可以了啊
    然后把Form2关闭了
    去操作你的Form1
      

  4.   

    无论是用
    form2:=Tform2.create(self);
    try
        form2.showmodal;
    finally
        freeandnil(form2);
    end;还是用
    if not assigned(F_Employee_Find) then
        begin
          F_Employee_Find:=TF_Employee_Find.Create(self);
          F_Employee_Find.showmodal; //此处报错
        end
        else
          F_Employee_Find.ShowModal;
          
    都提示报错信息:Cannot make a visible window modal这是什么意思啊?
      

  5.   

    我把form2.visible:=false;就通过了但是,这样只是父表单调用子表单我在子表单返回父表单是,把程序设置如下:if not assigned(form1) then
    begin
       form1:=form1.Create(self);
       showmessage('form1 not assigned');
    end
    else
       showmessage('form1 have assigned');程序总是走showmessage('form1 not assigned');我想应该是别的地方出问题了,但是又没有方向,困惑阿。请大家指条明路吧,谢谢。
      

  6.   

    我找到问题了我在form1:=form1.Create(self);之前加了var form1:Tform1所以出错了问题解决,谢谢两位