进度条 [英] progress bars

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

问题描述

我一直在使用vb6一段时间但从未有过使用

进度条的乐趣。直到现在,我编写的其中一个程序已经被修改了,因此可以将100,000多行的大型csv文件导入到数据库中。

。 />

导入工作正常,但进度条功能无法正常工作。

进度条设置为csv中记录数的最大值

文件,然后导入记录并且进度条从零开始运行

到最大没问题。


但是进度条是一个文本框,应显示

百分比并更新每个导入循环,但它不会更新。它保持

空白,直到完全导入完成然后它将显示100%。但是如果你在调试模式下逐步完成程序,那么文本框就会正确更新。


有人对这个控件有任何乐趣。任何想法都会受到赞赏。

完整的导入例程太大而无法发布所以我已经简化了进度

bar如果有人想看看就会进入循环。


私有子cmdStart_Click()

虽然ProgressBar1.Value< ProgressBar1.Max



ProgressBar1.Value = ProgressBar1.Value + 1

txtPercentage.Text =(ProgressBar1.Value / ProgressBar1.Max) * 100& "%"

循环

Wend

结束子


干杯

Paul

i have been working with vb6 for a while but never had the pleasure of using
progress bars. That is until now, one of the programs i have written has
just been modified so that large csv files of 100,000+ lines can be imported
into a database.

the import works fine but the progress bar feature is not working correctly.
The progress bar is set to a max value of the number of records in the csv
file, the records are then imported and the progress bar runs from from zero
to max no problem.

however under the progress bar is a text box that should display the
percentage and update with each import loop but it doesnt update. it stays
blank until the full import is complete then it will show 100%. but if you
step through the program in debug mode the text box updates correctly.

has anyone had any joys with this control. any ideas will be appreciated.
the full import routine is too big to post so i have simplified the progress
bar into a loop if anyone wants to have a look.

Private Sub cmdStart_Click()
While ProgressBar1.Value < ProgressBar1.Max
Do
ProgressBar1.Value = ProgressBar1.Value + 1
txtPercentage.Text = (ProgressBar1.Value / ProgressBar1.Max) * 100 & "%"
Loop
Wend
End Sub

Cheers
Paul

推荐答案

嗨Paul,


评论内联...


-

要回复,请从地址中取出.OBVIOUS。


" Paul" < PA ** @ pgcomputing.net>在消息新闻中写道:1g ***************** @ news-binary.blueyonder.co.uk ...
Hi Paul,

Comments inline...

--
To reply, take out the .OBVIOUS from the address.

"Paul" <pa**@pgcomputing.net> wrote in message news:1g*****************@news-binary.blueyonder.co.uk...
我一直在使用vb6一段时间但从未有过使用
进度条的乐趣。直到现在,我编写的其中一个程序已经被修改,以便可以将大约100,000多行的大型csv文件导入数据库。

导入工作正常但进度条功能无法正常工作。
进度条设置为csv
文件中记录数的最大值,然后导入记录并从中运行进度条从零到最大没有问题。

然而在进度条下面是一个文本框,应该显示
百分比并更新每个导入循环,但它不会更新。它保持空白直到完全导入完成然后它将显示100%。但是如果你在调试模式下逐步完成程序,文本框会正确更新。

任何人都对这个控件有任何乐趣。任何想法都会受到赞赏。
完整的导入程序太大而无法发布所以如果有人想看一下,我已经简化了进度吧。

私人Sub cmdStart_Click()
当ProgressBar1.Value< ProgressBar1.Max
执行进度巴尔值= ProgressBar1.Value + 1
txtPercentage.Text =(ProgressBar1.Value / ProgressBar1.Max)* 100& "%"


''刷新文本框

txtPercentage.Refresh


问候,


Stoil

循环
Wend
End Sub

干杯
Paul

i have been working with vb6 for a while but never had the pleasure of using
progress bars. That is until now, one of the programs i have written has
just been modified so that large csv files of 100,000+ lines can be imported
into a database.

the import works fine but the progress bar feature is not working correctly.
The progress bar is set to a max value of the number of records in the csv
file, the records are then imported and the progress bar runs from from zero
to max no problem.

however under the progress bar is a text box that should display the
percentage and update with each import loop but it doesnt update. it stays
blank until the full import is complete then it will show 100%. but if you
step through the program in debug mode the text box updates correctly.

has anyone had any joys with this control. any ideas will be appreciated.
the full import routine is too big to post so i have simplified the progress
bar into a loop if anyone wants to have a look.

Private Sub cmdStart_Click()
While ProgressBar1.Value < ProgressBar1.Max
Do
ProgressBar1.Value = ProgressBar1.Value + 1
txtPercentage.Text = (ProgressBar1.Value / ProgressBar1.Max) * 100 & "%"
''Refresh the textbox
txtPercentage.Refresh

Regards,

Stoil
Loop
Wend
End Sub

Cheers
Paul







谢谢你是一个明星,我大部分时间都在看这个

和我忘了像刷新一样简单的东西。我现在终于可以完成

计划了。


欢呼


保罗


" Stoil Marinov" < ST ******************* @ firemail.de>在留言中写道

news:be ************ @ ID-24932.news.dfncis.de ...

嗨Paul,


评论内联...


-

要回复,请从地址中取出.OBVIOUS 。


" Paul" < PA ** @ pgcomputing.net>在消息中写道

新闻:1g ***************** @ news-binary.blueyonder.co.uk ...
Thanks for that you are a star, i''ve spent most of the day looking at this
and i forget something as simple as a refresh. I can finally finish the
program now.

cheers

paul

"Stoil Marinov" <st*******************@firemail.de> wrote in message
news:be************@ID-24932.news.dfncis.de...
Hi Paul,

Comments inline...

--
To reply, take out the .OBVIOUS from the address.

"Paul" <pa**@pgcomputing.net> wrote in message
news:1g*****************@news-binary.blueyonder.co.uk...
我一直在使用vb6一段时间,但从来没有使用进度条获得
的乐趣。到目前为止,我编写的其中一个程序已被修改,以便将100,000多行的大型csv文件导入到数据库中。
导入到数据库中。

导入工作正常,但进度条功能正常工作
。进度条设置为csv
文件中记录数的最大值,然后导入记录,进度条从
零到最大没有问题。
<但是在进度条下面是一个文本框,应该显示
百分比并更新每个导入循环,但它不会更新。它保持空白直到完全导入完成然后它将显示100%。但是如果你在调试模式下逐步完成程序,文本框会正确更新。

任何人都对这个控件有任何乐趣。任何想法都会受到赞赏。
完整的导入程序太大了,所以我已经将
进度条简化为循环,如果有人想看看的话。

私有Sub cmdStart_Click()
当ProgressBar1.Value< ProgressBar1.Max
执行进度巴尔值= ProgressBar1.Value + 1
txtPercentage.Text =(ProgressBar1.Value / ProgressBar1.Max)* 100&
"%"


''刷新文本框

txtPercentage.Refresh


问候,


Stoil

循环
Wend
结束子

干杯
Paul
i have been working with vb6 for a while but never had the pleasure of using progress bars. That is until now, one of the programs i have written has
just been modified so that large csv files of 100,000+ lines can be imported into a database.

the import works fine but the progress bar feature is not working correctly. The progress bar is set to a max value of the number of records in the csv
file, the records are then imported and the progress bar runs from from zero to max no problem.

however under the progress bar is a text box that should display the
percentage and update with each import loop but it doesnt update. it stays
blank until the full import is complete then it will show 100%. but if you
step through the program in debug mode the text box updates correctly.

has anyone had any joys with this control. any ideas will be appreciated.
the full import routine is too big to post so i have simplified the progress bar into a loop if anyone wants to have a look.

Private Sub cmdStart_Click()
While ProgressBar1.Value < ProgressBar1.Max
Do
ProgressBar1.Value = ProgressBar1.Value + 1
txtPercentage.Text = (ProgressBar1.Value / ProgressBar1.Max) * 100 & "%"

''Refresh the textbox
txtPercentage.Refresh

Regards,

Stoil
Loop
Wend
End Sub

Cheers
Paul



嗨Paul,

尝试在循环中放入DoEvents。否则VB忙于

导入它没有时间来更新进度条。

质子队长


保罗 < PA ** @ pgcomputing.net> schreef在bericht

新闻:1g ***************** @ news-binary.blueyonder.co.uk ...
Hi Paul,
Try putting a DoEvents inside your loop. Otherwise VB is so busy with the
import that it doesn''t have the time to update the progress bar.
Captain Proton

"Paul" <pa**@pgcomputing.net> schreef in bericht
news:1g*****************@news-binary.blueyonder.co.uk...
我一直在使用vb6一段时间,但从来没有使用进度条获得
的乐趣。到目前为止,我编写的其中一个程序已被修改,以便将100,000多行的大型csv文件导入到数据库中。
导入到数据库中。

导入工作正常,但进度条功能正常工作
。进度条设置为csv
文件中记录数的最大值,然后导入记录,进度条从
零到最大没有问题。
<但是在进度条下面是一个文本框,应该显示
百分比并更新每个导入循环,但它不会更新。它保持空白直到完全导入完成然后它将显示100%。但是如果你在调试模式下逐步完成程序,文本框会正确更新。

任何人都对这个控件有任何乐趣。任何想法都会受到赞赏。
完整的导入程序太大了,所以我已经将
进度条简化为循环,如果有人想看看的话。

私有Sub cmdStart_Click()
当ProgressBar1.Value< ProgressBar1.Max
执行进度巴尔值= ProgressBar1.Value + 1
txtPercentage.Text =(ProgressBar1.Value / ProgressBar1.Max)* 100&
"%"循环
结束

干杯
保罗
i have been working with vb6 for a while but never had the pleasure of using progress bars. That is until now, one of the programs i have written has
just been modified so that large csv files of 100,000+ lines can be imported into a database.

the import works fine but the progress bar feature is not working correctly. The progress bar is set to a max value of the number of records in the csv
file, the records are then imported and the progress bar runs from from zero to max no problem.

however under the progress bar is a text box that should display the
percentage and update with each import loop but it doesnt update. it stays
blank until the full import is complete then it will show 100%. but if you
step through the program in debug mode the text box updates correctly.

has anyone had any joys with this control. any ideas will be appreciated.
the full import routine is too big to post so i have simplified the progress bar into a loop if anyone wants to have a look.

Private Sub cmdStart_Click()
While ProgressBar1.Value < ProgressBar1.Max
Do
ProgressBar1.Value = ProgressBar1.Value + 1
txtPercentage.Text = (ProgressBar1.Value / ProgressBar1.Max) * 100 & "%" Loop
Wend
End Sub

Cheers
Paul



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

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