我想在当满足一定的条件是才能关闭窗口,该如何做,还有如何在不同的窗体之间转递变量。立即给分!

解决方案 »

  1.   

    procedure form2.button1onclick(object,Tobject);
    begin
         if('满足条件') then 
            begin
                 application.determined;
           end;
    end;也可以用消息传递完成(message);
      

  2.   

    在Form的OnCloseQuery事件中写代码即可procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    begin
      if('不满足条件') then 
      begin
        CanClose := Flase;  //置为不能关
      end;
    end;
      

  3.   

    CanClose := False;   //汗  False竟写错了