带DlgType mtConfirmation常量的错误MessageDlg图标?

带DlgType mtConfirmation常量的错误MessageDlg图标?

问题描述:

在Delphi 10.1.2 Berlin中,在Vcl.Dialogs.MessageDlg函数中,DlgType常量mtInformationmtConfirmation创建相同的对话框图标。例如:带DlgType mtConfirmation常量的错误MessageDlg图标?

if Vcl.Dialogs.MessageDlg('Do you really want to remove the selected item?', mtConfirmation, mbOKCancel, 0) = mrOk then 
begin 
    RemoveTheSelectedItem; 
end; 

enter image description here

if Vcl.Dialogs.MessageDlg('Do you really want to remove the selected item?', mtInformation, mbOKCancel, 0) = mrOk then 
begin 
    RemoveTheSelectedItem; 
end; 

enter image description here

但不应在DlgType恒定mtConfirmation显示一个问号图标,(与其它DlgType常数mtWarningmtError创建每个一个不同的图标)?

如何获取问号图标DlgType常数mtConfirmation

+0

我今天正是这个问题..感谢要求,并感谢汤姆的回答 –

它在help说:

有mtConfirmation显示TMsgDlgType.mtConfirmation类型的问号

的对话框显示的信息 图标。

在过去,他们用来显示一个问号代替,但微软 删除从 的VCL用来显示TMsgDlgType.mtConfirmation对话框中的Windows API函数的问号。 引用Microsoft:“问号消息图标不再是 ,因为它没有明确表示消息的特定类型,并且因为作为问题的消息措辞可能适用于任何消息类型。另外,用户可以将消息 符号问号与帮助信息混淆。“要使用先前的 对话框外观,必须将Vcl.Dialogs单元的UseLatestCommonDialogs 变量设置为False。

所以这个代码:

Vcl.Dialogs.UseLatestCommonDialogs := False; 
    if Vcl.Dialogs.MessageDlg('Do you really want to remove the selected item?', mtConfirmation, mbOKCancel, 0) = mrOk then 
    begin 
    RemoveTheSelectedItem; 
    end; 

会产生这样的结果:

enter image description here

+0

我实在无法遵循微软的逻辑。符号的含义总是由其上下文来定义的。这意味着:当我可以采取行动的控制(例如按钮)具有问号符号时,我可以使用它来获取信息。但是对话框中的问号不能被执行,所以它给了对话BEING信息的含义。 – user1580348