我应该在 Windows 消息框中使用警告图标还是问号图标?

发布于 2024-11-08 06:24:41 字数 479 浏览 0 评论 0 原文

许多人都知道“问题”类型的 MessageBoxIcon。如果你对这个图标不是特别熟悉,它只是一个美化的问号。我很好奇这个图标在专业应用程序中是否可以接受。例如,假设我有一个按钮,单击该按钮将清除整个表单上的所有文本字段。单击按钮时,我想警告用户他的操作将要做什么。我可以写以下任一内容:

MessageBox.Show("Really clear all data?", "Clear confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

或者

MessageBox.Show("Really clear all data?", "Clear confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

你们认为两者中哪一个更专业?

Many know of the MessageBoxIcon of type "question". If you are not particularly familiar with this icon, it is just a glorified question mark. I am curious as to whether or not this icon is acceptable in professional applications. For example, let's assume that I have a button which, when clicked, will clear all text fields on the entire form. When the button is clicked I would like to warn the user about what his action is about to do. I could write either of the following:

MessageBox.Show("Really clear all data?", "Clear confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

OR

MessageBox.Show("Really clear all data?", "Clear confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

Which would you all say is the more professional of the two?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

萌梦深 2024-11-15 06:24:41

我真的不认为这是“专业”的问题,但这绝对违背了微软的指导方针。

MB_ICONQUESTION 标志的文档具有以下内容说(对于MessageBoxIcon 枚举):

消息框中出现一个问号图标。不再推荐使用问号消息图标,因为它不能清楚地表示特定类型的消息,而且将消息表述为问题可以适用于任何消息类型。此外,用户可能会将消息符号问号与帮助信息混淆。因此,请勿在消息框中使用此问号消息符号。系统继续支持其包含只是为了向后兼容。

Windows 用户体验交互指南的 标准图标 部分说得非常明确问号图标应该用于指示“帮助入口点”:

问号图标

  • 仅对帮助入口点使用问号图标。有关详细信息,请参阅帮助入口点指南。
  • 请勿使用问号图标提问。再次强调,请仅在帮助入口点使用问号图标。无论如何,没有必要使用问号图标来提问 - 将主要说明作为问题就足够了。
  • 不要经常用警告图标替换问号图标。仅当问题具有重大后果时才将问号图标替换为警告图标。否则,不使用图标。

我强烈建议您阅读整个文档;它提供了许多有关选择正确图标的有用提示。但在这种特殊情况下,由于您要求用户确认涉及潜在数据丢失的操作,因此您绝对应该使用警告图标,与本指南一致:

  • 对于问题对话框,仅对具有重大后果的问题使用警告图标。

I don't really think it's an issue of "professionalism", but it definitely contradicts Microsoft's guidelines.

The documentation for the MB_ICONQUESTION flag has this to say (and the same for the "Question" member of the MessageBoxIcon enum):

A question-mark icon appears in the message box. The question-mark message icon is no longer recommended because it does not clearly represent a specific type of message and because the phrasing of a message as a question could apply to any message type. In addition, users can confuse the message symbol question mark with Help information. Therefore, do not use this question mark message symbol in your message boxes. The system continues to support its inclusion only for backward compatibility.

And the Standard Icons section of the Windows User Experience Interaction Guidelines says very explicitly that the question mark icon should only be used to indicate a "Help entry point":

Question mark icons

  • Use the question mark icon only for Help entry points. For more information, see the Help entry point guidelines.
  • Don't use the question mark icon to ask questions. Again, use the question mark icon only for Help entry points. There is no need to ask questions using the question mark icon anyway—it's sufficient to present a main instruction as a question.
  • Don't routinely replace question mark icons with warning icons. Replace a question mark icon with a warning icon only if the question has significant consequences. Otherwise, use no icon.

I highly recommend that you read the entire document; it provides lots of helpful tips on choosing the correct icon. But in this particular case, since you're asking the user to confirm an operation that involves the potential loss of data, you should definitely use the warning icon, consistent with this guideline:

  • For question dialogs, use warning icons only for questions with significant consequences.
三五鸿雁 2024-11-15 06:24:41

我会在对话框中使用警告图标,警告用户将发生不好的(或不可逆转的)事情。

警告图标的目的是吸引用户注意他即将犯错误。
即使对话框包含问题也是如此。

I would use a warning icon for dialogs that warn the user that something bad (or irreversible) will happen.

The point of a warning icon is to draw the user's attention to the fact that he's about to make a mistake.
This is true even if the dialog contains a question.

萤火眠眠 2024-11-15 06:24:41

清除数据是需要正确突出显示的事情。必须警告用户,特别是当它是所有数据时,并且如果您没有任何备份解决方案。因此第二个更适合这种情况

Well clearing data is something that needs to highlighted correctly. The users must be warned, especially when it is All Data, and if you don't have any backup solutions. Thus the second one is more appropriate in this scenario

萧瑟寒风 2024-11-15 06:24:41

我通常遵循的规则是,如果您使用警告图标,它应该指示问题,例如:

数据清除无法撤消。想要继续吗?

一个问题更像是:

您确定要清除所有数据吗?

文本也应该是完整且语法正确的句子。

I generally follow the rule that if you use a Warning icon, it should indicate the issue, like:

Clearing of the data cannot be undone. Would like to continue?

A question would be more like:

Are you sure you want to clear all the data?

The text should also be complete and grammatically correct sentences.

邮友 2024-11-15 06:24:41

比图标更重要的是:如果您认为“否”按钮有潜在风险,则应将其设为默认按钮,即使用采用 MessageBoxDefaultButton 参数的重载并指定:

...,MessageBoxDefaultButton.Button2

More important than the icon: you should make the No button the default if you feel it's a potentially risky action, i.e. use an overload that takes a MessageBoxDefaultButton parameter and specify:

...,MessageBoxDefaultButton.Button2
┊风居住的梦幻卍 2024-11-15 06:24:41

最专业的做法是使操作不可撤销,从而使确认/警告完全不必要。

如果确实无法撤消,请遵循 Windows 指南,正如 Cody 在他的回答中列出的那样。

The most professional thing would be to make the action undoable, and thus make the confirmation/warning completely unnecessary.

If it truly cannot be undoable, then follow the Windows guidelines, as Cody listed in his answer.

天气好吗我好吗 2024-11-15 06:24:41

他们同样专业或不专业,具体取决于您的观点 =)。您应该考虑您想要与用户沟通的内容。根据您对问题的描述,我倾向于使用“警告”,因为清除这些字段似乎可能会产生负面后果。

They're equally professional or unprofessional depending on your perspective =). You should consider what you are trying to communicate to your user. From your description of the problem, I would lean towards using 'warning' since it seems that clearing these fields may have negative consequences.

一个人的旅程 2024-11-15 06:24:41

事实上,你可以使用其中任何一个,而且看起来都不错。但这并不意味着它的设计是正确的。

清除所有用户数据应该有一个警告图标。

原因是什么?您弹出的消息应该传达当前的情况。使用?图标可能无法传达正确的信息。但使用警告图标确实如此 - 因为应该警告用户应用程序打算清除她的所有数据。

The reality of it is you could use either, and it would look fine. But that wouldn't mean it was designed correctly.

Clearing all the user's data is something that should have a warning icon.

The reason? The message you are popping up should convey the situation at hand. Using the ? icon probably doesn't convey the right message. Using the warning icon does though - since the user should be warned that the application intends to clear all of her data.

暖风昔人 2024-11-15 06:24:41

老实说..我会说“您确定要清除所有数据吗”而不是“真的清除所有数据吗?”...不管图标是什么。

有关图标的信息,您可以阅读其他帖子!

Honestly.. I would say "Are you sure you wish to clear all data" instead of "Really clear all data?"... No mather what the icon is.

For information on the icon you can read the other posts!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文