【Delphi】MessageDlg() でアイコンが表示されない #プログラミング - Qiita

12 Athens で MessageDlg() を使うと mtInformationmtConfirmation を指定したダイアログでアイコンが表示されません。

  MessageDlg('Hello,world.', TMsgDlgType.mtWarning     , [mbOK], -1);
  MessageDlg('Hello,world.', TMsgDlgType.mtError       , [mbOK], -1);
  MessageDlg('Hello,world.', TMsgDlgType.mtInformation , [mbOK], -1);
  MessageDlg('Hello,world.', TMsgDlgType.mtConfirmation, [mbOK], -1);

image.png

image.png

image.png

image.png

See also:

要は Microsoft のガイドラインに基づく変更で「確認ダイアログにアイコンを使うな!」という事らしいです。

従来の挙動に戻すには

アイコンを従来の挙動に戻すにはグローバル配列変数 MsgDlgIcons[] を操作します。

12 Athens では初期状態で次のように設定されているので、

TMsgDlgType TMsgDlgIcon
mtWarning mdiWarning
mtError mdiError
mtInformation mdiNone
mtConfirmation mdiNone
mtCustom mdiNone

11.3 Alexandria 相当にするには次のコードを追加します。

  MsgDlgIcons[TMsgDlgType.mtInformation]  := TMsgDlgIcon.mdiInformation;
  MsgDlgIcons[TMsgDlgType.mtConfirmation] := TMsgDlgIcon.mdiWarning;

image.png

image.png

image.png

image.png

11.2 Alexandria 相当にするには次のコードを追加します。

  MsgDlgIcons[TMsgDlgType.mtInformation]  := TMsgDlgIcon.mdiInformation;
  MsgDlgIcons[TMsgDlgType.mtConfirmation] := TMsgDlgIcon.mdiInformation;

この問題は UseLatestCommonDialogs を False に設定しても解決しません。

See also:

昔話

Windows 3.1 のダイアログとアイコンです。アイコンの色はすべて異なっていました。

image.png

image.png

image.png

image.png

いや、アイコンあった方がよくない?前も似たような理由で疑問符アイコン無くした 1 よね?

See also:



フラッグシティパートナーズ海外不動産投資セミナー 【DMM FX】入金

Source link