问题描述
我使用功能由Win 32框架提供以显示是和否消息框。我需要保持启用关闭按钮(右上角的X),但不幸的是,只有在窗口中还包含取消按钮时才可用。
I'm using the MessageBox function provided by the Win 32 framework to display a Yes and No message box. I need to keep enabled the close button (the X in the top right corner) but unfortunately seems that is available only when the window contains also a Cancel button.
这是真的还是有其他方法来实现这个?
Is it true or there is some other way to achieve this?
推荐答案
UX准则。在模态对话框中,如果显示关闭按钮,用户需要清楚地预期该按钮引起的动作。而且平台用户体验指南是关闭按钮执行取消操作。
The message box design reflects the platform UX guidelines. In a modal dialog, if you present a close button, the user needs to have a clear expectation of what action that button provokes. And the platform UX guideline is that the close button performs the cancel action.
所以,这就是为什么关闭按钮启用时如果对话框显示取消按钮。此设计允许用户确信当他们按下关闭按钮时,与对话框相关的动作将被取消。
So, that is why the close button is enabled if and only if the dialog presents a cancel button. This design allows the user to be confident that when they press the close button, the action relating to the dialog will be cancelled.
API没有提供机制在标准消息框中颠覆该UX设计。如果您渴望提供自己的UX设计,这与平台UX标准不同,那么您可以创建自己的对话框并使用它。一旦你创建了自己的对话框,你可以启用或禁用任何按钮你可以。
There is no mechanism provided by the API to subvert this UX design in the standard message box. If you are keen to offer your own UX design, that varies from the platform UX standard, then you can create your own dialog and use that. Once you create your own dialog, you are able to enable or disable whatever buttons you please.
但是,我敦促你不要这样做。你打算提出一个对话框有一个是/否的问题,并有关闭按钮用于表示没有。这是与当前的平台UX相反,并且会让用户感到困惑。如果取消操作无意义,则不要提供关闭按钮,因为关闭按钮意味着取消。
However, I urge you not to do this.You intend to present a dialog with a yes/no question and have the close button be used to mean either no. That is counter to the prevailing platform UX and will be confusing to users. If the cancel action is not meaningful, then do not offer a close button since the close button means cancel.
这篇关于在Win 32消息框中启用关闭按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!