为什么我在formclose事件中加入如下代码,然后点击否,也退出程序那?
begin
if application.messagebox('确实要退出吗?','',mb_yesno+mb_iconinformation)=mryes then
application.terminate;
end;
begin
if application.messagebox('确实要退出吗?','',mb_yesno+mb_iconinformation)=mryes then
application.terminate;
end;
begin
if mrNo = MessageDlg('确实要退出吗?', mtConfirmation, [mbYes, mbNo], 0) then
Abort
else
begin
CloseForm();
end;
end;
if application.messagebox('确实要退出吗?','',mb_yesno+mb_iconinformation)=mryes then
application.terminate
else
Action:=caNone;
end;
都说了揭贴吧
procedure TFrmMain.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
if application.messagebox('确实要退出吗?','',mb_yesno+mb_iconinformation)
=IDyes then
application.terminate;
end;
mryes改为idyes
var
i:integer;
begin
i:=application.messagebox('确实要退出吗?','',mb_yesno);
if i=IDyes then
application.terminate;
end;
begin
if mrNo = MessageDlg('确实要退出吗?', mtConfirmation, [mbYes, mbNo], 0) then
Abort
else
begin
CloseForm();
end;
end;