带DlgType mtConfirmation常量的错误MessageDlg图标?
在Delphi 10.1.2 Berlin中,在Vcl.Dialogs.MessageDlg
函数中,DlgType
常量mtInformation
和mtConfirmation
创建相同的对话框图标。例如:带DlgType mtConfirmation常量的错误MessageDlg图标?
if Vcl.Dialogs.MessageDlg('Do you really want to remove the selected item?', mtConfirmation, mbOKCancel, 0) = mrOk then
begin
RemoveTheSelectedItem;
end;
if Vcl.Dialogs.MessageDlg('Do you really want to remove the selected item?', mtInformation, mbOKCancel, 0) = mrOk then
begin
RemoveTheSelectedItem;
end;
但不应在DlgType
恒定mtConfirmation
显示一个问号图标,(与其它DlgType
常数mtWarning
和mtError
创建每个一个不同的图标)?
如何获取问号图标DlgType
常数mtConfirmation
?
它在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;
会产生这样的结果:
我实在无法遵循微软的逻辑。符号的含义总是由其上下文来定义的。这意味着:当我可以采取行动的控制(例如按钮)具有问号符号时,我可以使用它来获取信息。但是对话框中的问号不能被执行,所以它给了对话BEING信息的含义。 – user1580348
我今天正是这个问题..感谢要求,并感谢汤姆的回答 –