Recent

Author Topic: BitBtn with icons to MessageDlg  (Read 2312 times)

Milsa

  • Sr. Member
  • ****
  • Posts: 328
BitBtn with icons to MessageDlg
« on: October 13, 2015, 07:30:24 pm »
I want show MessageDlg Window with icons on buttons (BitBtn). It is possible?
I work with Lazarus 4.0, FPC 3.2.2, date 2025-05-03
This information is actual to: 3rd Aug 2025

wp

  • Hero Member
  • *****
  • Posts: 13334
Re: BitBtn with icons to MessageDlg
« Reply #1 on: October 14, 2015, 01:21:13 am »
Use CreateMessageDialog from Dialogs.pas - it looks a bit different, though:

Code: Pascal  [Select][+][-]
  1. function MyMessageDlg(const aMsg: string; DlgType: TMsgDlgType;
  2.   Buttons: TMsgDlgButtons): TModalResult;
  3. begin
  4.   with CreateMessageDialog(aMsg, DlgType, Buttons) do
  5.   begin
  6.     Result := ShowModal;
  7.     Free;
  8.   end;
  9. end;
  10.  
  11. procedure TForm1.Button1Click(Sender: TObject);
  12. begin
  13.   MyMessageDlg('Something is wrong...', mtError, [mbOK, mbCancel]);
  14. end;  
  15.  


Milsa

  • Sr. Member
  • ****
  • Posts: 328
Re: BitBtn with icons to MessageDlg
« Reply #2 on: October 14, 2015, 09:16:41 pm »
Thank you very much.
I work with Lazarus 4.0, FPC 3.2.2, date 2025-05-03
This information is actual to: 3rd Aug 2025

 

TinyPortal © 2005-2018