声明一个integer变量,例如:myresult:integer;
   然后 myresult:=form1.showmodal;
   接着 IF myrerult=mrOK 
            试一试!

解决方案 »

  1.   

    我试了无问题的.  form1 为 MainForm, form2.Formstyle = fsNamorl;
      form1 加上一 Button1,
      事件 Button1OnClik:  
      begin
        Form2 := TForm.Create(Self); //也可不用
        if Form2.Showmodal = mrOK then
           showmessage('aaaaaa');
        Form2.Free;
            
      end;
      

  2.   


     form1 为 MainForm, form2.Formstyle = fsNamorl;
      form1 加上一 Button1,
      事件 Button1OnClik:  
      begin
        if not assigned(form2) then application.createform(Tform2.form2); 
        if Form2.Showmodal = mrOK then
          showmessage('aaaaaa');
        Form2.Free;
        form2:=nill;
          
      end;
    另外:form2中的Onshow事件中不允许存在set focus 等不应在此执行的事件