Dialogs - QuestionDlg ... lazarus / 7-LCL ---------------------------------------------------------------------- seghele0 · 2021-11-07 15:09 I'm just an amateur programmer who tries to understand Pascal and program everything through self-study and 'Google (Forums)'. My knowledge is really limited. It would be a good idea to be able to choose a bitmap for the buttons in a 'questiondlg' or other dialogue messages. This instead of the normal text 'yes'-'no' - or - as a supplementary option. Perhaps this can become an additional option in the current component. Thanks with greetings from Belgium. ---------------------------------------------------------------------- Bart · 2021-11-07 16:37 If you start with the CreateMessageDialog function in dialogs unit, then you have access to the underlying form. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button2Click(Sender: TObject);var  F: TForm;  i: Integer;  C: TComponent;  B: TBitBtn;  Res: TModalResult;begin  F := CreateMessageDialog('Dare to take a choice?', 'Do you want to format your harddrive?', mtConfirmation, [mbYes, mbNo, mbAbort, mbRetry, mbCancel, mbOK]);  for i := 0 to F.ComponentCount-1 do  begin    C := F.Components[i];    if (C is TBitBtn) then    begin      B := TBitBtn(C);      case B.Kind of        bkYes: B.Caption := 'No';      bkNo: B.Caption := 'Yes';        bkAbort: B.Caption := 'Ok';        bkRetry: B.Caption := 'Cancel';        bkCancel: B.Caption := 'Retry';        bkOk: Caption := 'Abort';      end;    end;  end;  Res := F.ShowModal;  F.Free;end; In this simple code I change the buttons captions, just to confuse them. You can do anything you want with the buttons now you have access to them. I use a similar approach to have a checkbox with "Don't show this dialog anymore" on the dialog. Note: You cannot access the components anymore after you freed the form (F in this case). Bart ---------------------------------------------------------------------- seghele0 · 2021-11-08 09:16 Thank you for your information. I'll try it. ---------------------------------------------------------------------- seghele0 · 2021-11-08 09:46 This is my result: With error: Compile Project, Target: project1.exe: Exit code 1, Errors: 1 unit1.pas(34,1) Fatal: illegal character "'Â'" ($C2) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit Unit1;{$mode objfpc}{$H+}interfaceuses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls;type  { TForm1 }  TForm1 = class(TForm)    Button1: TButton;    procedure Button1Click(Sender: TObject);  private  public  end;var  Form1: TForm1;implementation {$R *.lfm} { TForm1 } procedure TForm1.Button1Click(Sender: TObject);var  F: TForm;  i: Integer;  C: TComponent;  B: TBitBtn;  Res: TModalResult;begin  F := CreateMessageDialog('Dare to take a choice?', 'Do you want to format your harddrive?', mtConfirmation, [mbYes, mbNo, mbAbort, mbRetry, mbCancel, mbOK]);  for i := 0 to F.ComponentCount-1 do  begin    C := F.Components[i];    if (C is TBitBtn) then    begin      B := TBitBtn(C);      case B.Kind of        bkYes: B.Caption := 'No';        bkNo: B.Caption := 'Yes';        bkAbort: B.Caption := 'Ok';        bkRetry: B.Caption := 'Cancel';        bkCancel: B.Caption := 'Retry';        bkOk: Caption := 'Abort';      end;    end;  end;  Res := F.ShowModal;  F.Free;end; end. ---------------------------------------------------------------------- seghele0 · 2021-11-08 12:43 I've installed the application 'HXD Hex Editor'. Wich file must be changed ? ---------------------------------------------------------------------- seghele0 · 2021-11-08 15:15 Sorry, I see the multiple "c2" in my Unit1.pas, but I can't change them to "32". Too bad there isn't a simple workable example on Google with your code. ---------------------------------------------------------------------- seghele0 · 2021-11-08 16:51 Bizarre, this would be the first time. I do use Windows 11 now! Personally I can't solve this problem. So it will not be solved. Thanks in any case.