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() + "%";
精彩评论