一条代码行的进度条 [英] Progress bar for one single code line

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

问题描述


我的代码包含一行,大约需要8秒甚至更长的时间.
我想向用户表明该进程仍处于活动状态.
问题:
1.我不知道要花多少时间,大约在0毫秒到2分钟之间.
2.我不能使用background-worker,因为它只有一行,所以进度将在0%到100%之间,并且在此之间的任何时间都不会显示任何内容.

也许是沙漏"或某些进度条,但没有百分比?
我该怎么办?
谢谢,
Shai.

Hi,
I have a code that contain one line that take something like 8 seconds or even more.
I want to make some indication for the user that the process is still active.
problems:
1. I don''t know how much time it will take, something between 0 milliseconds and 2 minutes.
2. I can''t use background-worker because it''s only one line so the progress will be between 0% to 100% and will show nothing in the time between.

Maybe ''hourglass'' or some Progress bar but not with percent?
What should I do?
Thanks,
Shai.

推荐答案

,您可以将进度条的Style属性设置为"Marquee",它只会显示连续的进度...
you can set the Style property of the progressbar to "Marquee" and it would just show a continuous progress ...


谢谢:-)
这非常有用...
我创建了一个新类,该类继承自Progressbar 并包含BackgroundWorker ,用于在不同线程中进行事件处理,该线程也可以在主应用程序中递增ProgressBar .
Thanks :-)
It was very useful...
I create a new class that inherit from Progressbar and contains BackgroundWorker for doing the event in a diffrent thread that can also increment the ProgressBar in the main application.


这篇关于一条代码行的进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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