如何以窗口形式添加等待过程? [英] How to add waiting process in window form?

查看:135
本文介绍了如何以窗口形式添加等待过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用C#创建一个窗口应用程序.现在差不多完成了.但是我想要这个应用程序中的另一个功能,但我不知道该如何实现.正在进行任何处理时,我希望我的应用程序中显示请等待"消息.完成后,该消息将被隐藏.

我不知道该怎么做,请专家请帮我解决这个问题.

I am creating a window application in c#. It is almost complete now. But I want one more feature in this application which I do not know how to achieve. I want a "PLEASE WAIT" message in my application while any of processing is on process. when it finish the message will be hide.

I don''t know how to do this please experts please help me to sort out this problem

推荐答案

你好,
为什么不更改光标以使其在进程开始时等待并在进程结束时恢复呢?
如果您的流程在执行任务,则可以使用事件Progresschanged处理您的消息框.
最好的问候.
Hello,
Why not changing the cursor to wait at process start and restore it at end of process?
If your processes are in task, you can use the event Progresschanged to handle your message box.
Best regards.


最简单的方法是使用Timer对象,并使用较短的时间间隔(例如100 ms)检查将设置为wait flag 的时间.当流程开始时为true,在流程结束时为false.等待表单将在进程启动时被激活,并且timer方法将根据wait flag.
The simplest way for doing this is by using a Timer object and use a short time interval (like 100 ms) to check a wait flag that will be set on true when the process start and on false when the process will be finished. The wait form will be activated when the process start and the timer method will check when to close it based on the wait flag.


这篇关于如何以窗口形式添加等待过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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