はじめに
12 Athens で MessageDlg()
を使うと mtInformation
や mtConfirmation
を指定したダイアログでアイコンが表示されません。
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);
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;
11.2 Alexandria 相当にするには次のコードを追加します。
MsgDlgIcons[TMsgDlgType.mtInformation] := TMsgDlgIcon.mdiInformation;
MsgDlgIcons[TMsgDlgType.mtConfirmation] := TMsgDlgIcon.mdiInformation;
この問題は UseLatestCommonDialogs を False に設定しても解決しません。
See also:
昔話
Windows 3.1 のダイアログとアイコンです。アイコンの色はすべて異なっていました。
おわりに
いや、アイコンあった方がよくない?前も似たような理由で疑問符アイコン無くした 1 よね?
See also:
- 標準アイコン (learn.microsoft.com)
- Windows XPとWindows Vistaのメッセージ系ダイアログを画面キャプチャで比較 (山本隆の開発日誌)
- 【Delphi】メッセージボックス表示時にデフォルトボタンを指定 (Migaro. 技術Tips)
-
Windows Vista 以降のガイドライン ↩