模态窗口应关闭,而无需用户输入 [英] Modal window should get closed without any input from user

查看:87
本文介绍了模态窗口应关闭,而无需用户输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我创建了一个对话框,它仅显示一条消息(例如-进行中....).该对话框上没有任何控件(按钮等),并且正在使用Domodal()进行显示.

我希望在没有任何用户输入的情况下关闭该对话框.由于Domodal()要求用户提供任何输入.我无法关闭.

我正在使用VC ++.

请提出建议,如何关闭该对话框.
还是有更好的方法来实现这一目标.

请提出建议.

提前致谢

Hi,

I have created a Dialog box, It shows only a message (E.g - In progress....). There isn''t any controls(Pushbutton etc) on that Dialog and am showing it using Domodal().

I want that Dialog to get closed without any user input. Since Domodal() requires any input from user. I am unable to close.

I am using VC++.

Please suggest, How to close that dialog.
Or is there any better way to achieve this.

Please suggest.

Thanks In advance

推荐答案

要以编程方式关闭模式对话框,您必须调用其EndDialog()方法,并提供退出代码(由DoModal()方法).
To close a modal dialog programmatically, you have to call its EndDialog() method, providing the exit code (which is the one returned by the DoModal() method).


在对话框中放置一个计时器,并在计时器刻度上关闭计时器
Put a timer in the dialog and have it close itself on the timer tick


为什么不使用进度栏 [
Why not use a Progress Bar[^] which allows you to provide useful information for your users? I don''t use MFC so I''m not sure whether there is an MFC class for this but I''m sure Bing can find it for you.


这篇关于模态窗口应关闭,而无需用户输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆