如何使进度条在我的Web浏览器中工作? [英] How Do I Make The Progress Bar Work In My Web Browser?

查看:84
本文介绍了如何使进度条在我的Web浏览器中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我想知道我的代码有什么问题。进度条根本不起作用。它显示错误。

'10000'的值对'值'无效。'值'应介于'最小'和'最大'之间。

参数名称:值



如何使这项工作?

这里是我的进度条代码

hello, i want to know what is wrong with my code. the progress bar wont work at all. it shows an error.
"Value of '10000' is not valid for 'Value'. 'Value' should be between 'minimum' and 'maximum'.
Parameter name: Value"

how to make this work?
here is my code for progress bar

if (e.CurrentProgress > 0)
                {
                    progressBar1.Value = Convert.ToInt32(e.CurrentProgress);
                    progressBar1.Maximum = Convert.ToInt32(e.MaximumProgress);
                    progressBar1.Minimum = (0);
                  
                }
                else
                    progressBar1.Value = Convert.ToInt32(0);

推荐答案

所有转换的内容是什么?



如果不知道你的e.CurrentProgress和e.MaximumProgress的值,那就具体了。



但是,在开始正在监视进度的操作之前,通常会设置ProgressBar控件的最小值和最大值属性。



然后你设置Value属性时,不会收到此错误消息,前提是它在已设置的两个Minimum和Maximum值之间。
What's with all the Converts?

Without knowing the values of your e.CurrentProgress and e.MaximumProgress, it's ahrd to be specific.

But, you'd normally set the Minimum and Maximum value properties of the ProgressBar control before you start the operation that you're monitoring for progress.

Then you won't get this error message when you set the Value property, provided it's between the two Minimum and Maximum values that have already been set.


这篇关于如何使进度条在我的Web浏览器中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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