从for循环更新进度条 [英] Update progress bar from for loop

查看:67
本文介绍了从for循环更新进度条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理for循环中的一些xml文件,根据要处理的文件数,我想显示进度条.假设目录中有100个文件,并且文件正在循环中一个接一个地处理,我想根据for循环的当前计数来更新进度条.
请提出建议.

I am processing some xml files in for loop and according to the number of files has been processed I want to show the progress bar. Suppose there are 100 files in directory and files are processing one by one in loop and I want to update the progress bar according to the current count of the for loop.
Please suggest..

推荐答案

您应该结合使用BackgroundWorker和ProgressBar控件.这是一个简单的示例.

You should use BackgroundWorker combined with a ProgressBar control. Here is a simple example.

这篇关于从for循环更新进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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