Jump to content
jesu

Delphi 12: MessageDlg doesn't show icons

Recommended Posts

Hello This code:


 

  if MessageDlg('Welcome to my Delphi application.  Exit now?',
    mtConfirmation, [mbYes, mbNo], 0, mbYes) = mrYes then
  begin
    MessageDlg('Exiting the Delphi application.', mtInformation,
      [mbOk], 0, mbOk);
    Close;
  end;

shows icons in previous versions, but not in Delphi 12.

This is too obvious to be a bug. Am I missing something?

Thanks.

 

Share this post


Link to post
4 hours ago, jesu said:

Hello This code:


 


  if MessageDlg('Welcome to my Delphi application.  Exit now?',
    mtConfirmation, [mbYes, mbNo], 0, mbYes) = mrYes then
  begin
    MessageDlg('Exiting the Delphi application.', mtInformation,
      [mbOk], 0, mbOk);
    Close;
  end;

shows icons in previous versions, but not in Delphi 12.

This is too obvious to be a bug. Am I missing something?

Thanks.

 

This has come up before. Microsoft changed the UI guidelines and now recommends to not show an icon for confirmation dialogs. D12's vcl.dialogs unit was modied accordingly.

Share this post


Link to post
Posted (edited)
  UseLatestCommonDialogs: Boolean = True;
  MsgDlgIcons: array[TMsgDlgType] of TMsgDlgIcon =
    (TMsgDlgIcon.mdiWarning, TMsgDlgIcon.mdiError, TMsgDlgIcon.mdiNone,
     TMsgDlgIcon.mdiNone, TMsgDlgIcon.mdiNone);

This is how they delete the standard dialogs (MessageBox) icons, except for Warning and Error.

Edited by DelphiUdIT

Share this post


Link to post

Any way to restore the previous behaviour?

That's what users have seen for many years and what they expect

Share this post


Link to post
  MsgDlgIcons[TMsgDlgType.mtInformation]:=TMsgDlgIcon.mdiInformation;
  MessageDlg('Exiting the Delphi application.', mtInformation,
      [mbOk], 0, mbOk);

You have to System.UITypes into the uses.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×