开发者

C# How to show the progressbar according to my percentage

I included a download option in my Windows application. I would like to update the progress bar result as per my calculated percen开发者_JAVA百科tage. I calculated the percentage in one class and used yield return to return the percentage:

 int percertage = ((int)(((decimal)Offset / (decimal)FileSize) * 100));
 yield return "Percentage: " + percertage.ToString() + "%";

How do I assign it to my progress bar update the value according to the percentage?


In the progress bar we have a function called PerformStep() using which we can make the progress of the progress bar increase slightly.

pBar1.PerformStep();


try this:

int percertage= ((int)(((decimal)Offset / (decimal)FileSize) * 100));
pgbrValue.Value = percertage;//it's in C#
yield return "Percentage : " + percertage.ToString() + "%";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜