许多人知道MessageBoxIcon类型为“问题”.如果你不太熟悉这个图标,那只是一个荣耀的问号.关于这个图标在专业应用中是否可以接受,我很好奇.例如,假设我有一个按钮,当单击时,将清除整个表单上的所有文本字段.当点击按钮时,我想向用户警告他的行动将要做什么.我可以写下列任一项:
MessageBox.Show("Really clear all data?","Clear confirmation",MessageBoxButtons.YesNo,MessageBoxIcon.Question);
要么
MessageBox.Show("Really clear all data?",MessageBoxIcon.Warning);
你们都会说这两个是更专业?
我不认为这是“专业精神”的问题,但这绝对违反了微软的指导方针.
原文链接:https://www.f2er.com/windows/371193.html对于MB_ICONQUESTION标志的@L_403_0@有这个说法(和MessageBoxIcon
enum的“Question”成员一样):
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.
而Windows用户体验互动指南的Standard Icons部分非常明确地表示,问号图标只能用于指示“帮助入口点”:
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.