Messagedialog avec 3 boutons

Dan5966 Messages postés 1 Date d'inscription mardi 19 mars 2024 Statut Membre Dernière intervention 19 mars 2024 - Modifié le 19 mars 2024 à 19:43
Excalibur_56 Messages postés 42 Date d'inscription jeudi 14 février 2019 Statut Membre Dernière intervention 18 avril 2024 - 18 avril 2024 à 20:00

Bonjour,

La routine ci dessous marche très bien avec 2 boutons 

mais j'aimerais en avoir 3 'OUI' 'NON' 'Annulation' ,toutes mes tentatives non rien données ,j'espère que vous pourrez m'aider. d'avance merci cordialement.

with CreateMessageDialog('Voulez ajouter ',mtwarning, mbokCancel) do
     try
      Caption := 'AJout';
     TLabel(FindComponent('Message')).Font.Color := $00C08000;
      TLabel(FindComponent('Message')).Font.name :='times new roman';// 'Mistral';
      TLabel(FindComponent('Message')).Font.Style := [fsbold];
      TLabel(FindComponent('Message')).Font.Size := 10;
      TButton(FindComponent('Cancel')).TabOrder := 1;

      TButton(FindComponent('Cancel')).Caption := 'Cancel';
      TButton(FindComponent('Cancel')).Hint := 'cancel!';
      TButton(FindComponent('Cancel')).ShowHint := True;

      TButton(FindComponent('Ok')).Caption   := 'OUI';
      TButton(FindComponent('Ok')).Hint      := 'OUI !';
      TButton(FindComponent('Ok')).ShowHint  := True;

     // TButton(FindComponent('NO')).TabOrder := 2;
    TButton(FindComponent('NO')).Caption := 'Non';
   //   TButton(FindComponent('NO')).Hint := 'Non !';
    //TButton(FindComponent('all')).ShowHint := True;

     // TImage(FindComponent('Image')).Transparent := True;
    //  ImageList1.GetBitmap(10, TImage(Findcomponent('Image')).Picture.Bitmap);
      AnimateWindow(Handle,200, AW_CENTER);
      Position := poScreenCenter;
      msg := ShowModal;
     finally
      Free;
      end;
    if msg=2 then exit ;
end;

1 réponse

Excalibur_56 Messages postés 42 Date d'inscription jeudi 14 février 2019 Statut Membre Dernière intervention 18 avril 2024
Modifié le 19 avril 2024 à 10:11

Bonsoir,

essaye ceci,

With CreateMessageDialog('Le message', mtWarning,[mbYes,mbAbort, mbCancel])do

begin

TButton(FindComponent('Yes')).....

end;


 

0
Rejoignez-nous