我得程序是:
procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
var
ch:integer;
begin
ch:=messagedlg('Are you sure exit?',mtconfirmation,[mbYes,mbNo],0);
if ch=mrNo then exit
else if ch=mrYes then
begin
Application.Terminate;
end;
end;
我点击'否'时,系统还是退出,为什么?有何办法?
procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
var
ch:integer;
begin
ch:=messagedlg('Are you sure exit?',mtconfirmation,[mbYes,mbNo],0);
if ch=mrNo then exit
else if ch=mrYes then
begin
Application.Terminate;
end;
end;
我点击'否'时,系统还是退出,为什么?有何办法?
begin
if application.messagebox('您确定要退出工程管理系统吗?','系统提示',mb_yesno+mb_iconquestion)=id_yes then
begin
//Endlogin;//修改操作员登录历史数据
canclose:=true;
end
else
begin
canclose:=false;
end;
end;我是这么写的,
var
ch:integer;
begin
ch:=messagedlg('Are you sure exit?',mtconfirmation,[mbYes,mbNo],0);
if ch=mrNo then canclose:=false
else if ch=mrYes then
begin
Application.Terminate;
end;
procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
var
ch:integer;
begin
ch:=messagedlg('Are you sure exit?',mtconfirmation,[mbYes,mbNo],0);
if ch=mrNo then Action := caFree {修改的语句}
else if ch=mrYes then
begin
Application.Terminate;
end;
end;
if ch=mrNo then Action := caFree {修改的语句}???