显示动画进度条的探针 [英] probelm in displaying animated progress bar

查看:107
本文介绍了显示动画进度条的探针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

萨拉姆!

我正在使用Visual Studio 2008和进度条组件.

我正在使用进度条来显示查询正在运行时.但是问题是,尽管显示了进度条的形式,但在执行过程中它是静态的.
首先,在调用查询函数之前,我要调用frmmain.show(包含进度条的表单)

然后,我调用了查询,并在查询循环中使用了更新功能(frmmain.update)来使进度条保持更新.该探针的含义是,在显示条形时,它保持静态.

谁能帮忙.与2008年相比有什么办法?

Salam!

I am using visual studio 2008 and using the progress bar component.

I am using the progress bar to show that while query is running. But the problem is that while the form of progress bar is shown it is static during the execution.
First before calling to my query function I am calling frmmain.show (form containing the progress bar)

Then I called my query and in query loop am using the update function (frmmain.update) to keep the progress bar updated. the probelm is that while showing the bar it remains static.

Can any one help. Is there any way of doing it in vs 2008?

推荐答案

首先声明您的最大值,最小值和起始值.
假设您的循环最多进行100次迭代.

First declare your maximum, minimum and startvalue.
Let''s assume your loop does a maximum of 100 iterations.

ProgressBar1.Maximum = 100
ProgressBar1.Minimum = 0
ProgressBar1.Value = 0




然后在您的循环中实现:




Then implement in your loop:

ProgressBar1.Value = ... [current loopvalue]


如果您希望程序保持响应状态,则必须使用线程和委托/事件.

做一些研究,有很多关于线程的文章.
If you want your program to remain responsive you''ll have to use threading and delegates / events.

Do some research there are a lot of articles about threading.


这篇关于显示动画进度条的探针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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