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

标签 .net windows user-interface icons messagebox

很多人都知道“问题”类型的 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);

你们觉得两者哪个更专业?

最佳答案

我真的不认为这是一个“专业性”的问题,但它肯定与微软的指导方针相矛盾。

documentation对于 MB_ICONQUESTION 标志有这样的说法(对于 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.

还有 Standard Icons Windows 用户体验交互指南的部分非常明确地指出,问号图标应该用于指示“帮助入口点”:

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.

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

  • For question dialogs, use warning icons only for questions with significant consequences.

关于.net - 我应该在 Windows 消息框中使用警告图标还是问号图标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6074455/

相关文章:

Java Swing JPanel FlowLayout 高度问题

.net - 使用 ASP.Net <asp :SiteMapPath> control 垂直对齐面包屑

.net - MSBuild 错误 : "Could not resolve this reference. Could not locate the assembly..."

.net - .NET 中的列表是否保持有序?

c# - 如何在 C# 中将 IList<T> 转换为 List<T>,性能良好且简洁?

c++ - InterlockedCompareExchange - 确切的对齐要求是什么以及如何执行它们?

windows - 将 'open' 传递给 ShellExecute 不会在特定计算机上打开 word 文件

c# - 使用 C# 选择数组的某些字符串

java - 如何向 jtextfield 添加填充

Java 高低网格游戏