重置进度在60% [英] ProgressBar resets at 60%

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

问题描述

我有这样的代码:

for(int k = 0; k<11; k++)
{
    pBar.Maximum = 10;
    pBar.Value = k;
    if (pBar.Maximum == k)
        pBar.Value = 0;
}



然而,问题在于,进度得到复位时约为60%充分。我怎样才能确保进度将填补一路被重置过吗?

However, the problem is, the progressbar gets reset when it is about 60% full. How can I ensure that the progressbar will fill all the way before being reset?

推荐答案

我终于找到了解决这个问题,并且写了关于它这里 。当时的想法是从这样呢的问题。

I finally found a solution to this problem, and wrote about it here. The idea was from THIS SO question.

     progressBar1.Value = e.ProgressPercentage;
     if (e.ProgressPercentage != 0)
         progressBar1.Value = e.ProgressPercentage - 1;
     progressBar1.Value = e.ProgressPercentage;
     if (progressBar1.Maximum == e.ProgressPercentage)
         progressBar1.Value = 0;

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

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