如何在MFC中禁用/隐藏/删除属性页的关闭(x)按钮?

发布于 2024-10-10 04:18:26 字数 129 浏览 0 评论 0原文

我正在使用属性表。最后一页包含“完成”按钮,该按钮显示注册成功的消息。

但是,如果用户单击(完成)属性页上的 x 按钮,DoModal 方法将返回 ID_CANCEL,这意味着注册不成功。

我该如何解决这个问题?

I am using a property sheet. The last page contains the Finish button which displays a successful registration message.

But if the user clicks the x button the (Finish) property page, the DoModal method returns ID_CANCEL meaning the registration was unsuccessful.

How can I solve the problem?

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

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

发布评论

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

评论(2

战皆罪 2024-10-17 04:18:26

OnInitDialog() 中删除 WS_SYSMENU 样式(这将删除关闭按钮):

ModifyStyle( WS_SYSMENU, 0 );

In OnInitDialog() remove the WS_SYSMENU style (which will remove the close button):

ModifyStyle( WS_SYSMENU, 0 );
2024-10-17 04:18:26

您应该在向导对话框中捕获关闭按钮事件,而不是删除关闭按钮,然后在此时放置一个“是/否”消息框,询问用户“他们是否确实要取消”向导?。

如果用户回答“是”,则只需关闭向导,但如果用户回答“否”,则取消该事件,并且向导将不会关闭。

如果您删除关闭按钮,您将拒绝用户以合法方式取消向导,我认为这是一个错误。

Rather than remove the close button, you should trap the close button event inside the wizard dialog and at that point put up a yes/no message box asking the user do they really want to cancel the wizard?.

If the user answers yes then then just dismiss the wizard, but if the user answered no then cancel the event and the wizard will not be closed.

If you remove the close button you will be denying the user of a legitimate way of cancelling the wizard and I think that is a mistake.

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