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