|
Registriert seit: 1. Feb 2018
3.691 Beiträge
Delphi 11 Alexandria
|
AW: TTaskDialog.Buttons.Add
25. Aug 2022, 23:20
Delphi-Quellcode:
with TTaskDialog.Create(self) do
try
Title := 'Confirm Removal';
Caption := 'Rejbrand BookBase';
Text := Format('Are you sure that you want to remove the book file named "%s"?', [FNameOfBook]);
CommonButtons := []; // <<<--- das ist entscheidend!
with TTaskDialogButtonItem(Buttons.Add) do
begin
Caption := 'Remove';
CommandLinkHint := 'Remove the book from the catalogue.';
ModalResult := mrYes;
end;
with TTaskDialogButtonItem(Buttons.Add) do
begin
Caption := 'Keep';
CommandLinkHint := 'Keep the book in the catalogue.';
ModalResult := mrNo;
end;
Flags := [tfUseCommandLinks];
MainIcon := tdiNone;
if Execute then
if ModalResult = mrYes then
DoDelete;
finally
Free;
end
how-to-use-the-ttaskdialog
|
|
|
Zitat
|