我现在要实现在关闭Form时,MessageDlg出现三个选择按钮,Yes、No和Cancel,我只能实现两个按钮的功能,请哪位大虾帮帮忙,帮我把下面的两个按钮实现的功能改为显示三个:
procedure TForm_Main.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if ( MessageDlg(是否保存信息?,mtConfirmation,[mbOk,mbCancel],0) = mrOK ) then
begin
Form_Main.TB_SaveClick(Self) ;
end;
Action := caFree ;
end;
我想实现的是:
Yes:保存信息并Close
No: 不保存Close
Cancel:不保存也不Close
多谢!
var
Reply:word;
begin
Reply:=MessageDlg(是否保存信息?,mtConfirmation,[mbOk,mbCancel,mbNo],0);
if Reply=mrOk then
begin
Form_Main.TB_SaveClick(Self) ;
action:=CaFree;
end
else if Reply=mrNo then
action:=CaFree;
else action:=caNone;
end;