procedure form2.button1onclick(object,Tobject); begin if('满足条件') then begin application.determined; end; end;也可以用消息传递完成(message);
在Form的OnCloseQuery事件中写代码即可procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin if('不满足条件') then begin CanClose := Flase; //置为不能关 end; end;
begin
if('满足条件') then
begin
application.determined;
end;
end;也可以用消息传递完成(message);
begin
if('不满足条件') then
begin
CanClose := Flase; //置为不能关
end;
end;