TTaskDialog/fr
English · Français · Suomi · Русский · 中文(中国)
TTaskDialog
est un composant non visuel, qui montre des boîtes de dialogue complètes à l'exécution, avec des fonctionnalités riches comme a l'API TaskDialog de Windows. . Il est disponible depuis Lazarus 1.8.

La boîte de dialogue est affichée avec la méthode Execute(), et quand elle retourne True, la propriété ModalResult contient l'Id du bouton pressé :
- id de bouton standard (OK, Cancel, Yes etc)
- id de bouron personnalisé, qui est spécifié dans la propriété ModalResult de chaque bouton.
Aussi, la propriété RadioButton a l'objet radio-button qui a été cliqué.
Exemple
Cette exemple montre comment créer la boîte de dialogue à l'exécution, et ajoute des boutons personnalisé à l'exécution :
with TTaskDialog.Create(self) do
try
Title := 'Confirm removal';
Caption := 'Confirm';
Text := 'Remove selected item?';
CommonButtons := [];
with TTaskDialogButtonItem(Buttons.Add) do
begin
Caption := 'Remove';
ModalResult := mrYes;
end;
with TTaskDialogButtonItem(Buttons.Add) do
begin
Caption := 'Keep';
ModalResult := mrNo;
end;
MainIcon := tdiQuestion;
if Execute then
if ModalResult = mrYes then
ShowMessage('Item removed');
finally
Free;
endFrom the Free Pascal wiki, page "TTaskDialog/fr", as it stood on 2020-03-02 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.
Talk about this page
Nobody has opened a bench for this page yet. Sign in to open one.
