Hello team,
I have a UltraStatusBar and added a Panel whose style is set to Progress. I want to show the user the progress of a long running process with its value. I set the Minimum as 0 and Maximum values as 100.
Now my I have a loop which runs for 265 iterations. Under this loop i am trying to update the ProgressBarInfo value as below, does not seem mathematically correct though :)
ultraStatusBar1.Panels["TestProgress"].ProgressBarInfo.Value =1;
for(int i=0;i<265;i++)
{
if( ultraStatusBar1.Panels["TestProgress"].ProgressBarInfo.Value < 100 && (ultraStatusBar1.Panels["TestProgress"].ProgressBarInfo.Value + 100 / 265 < 100)) { ultraStatusBar1.Panels["TestProgress"].ProgressBarInfo.Value += 100 / 265; }
}
I guess the ProgressBarInfo.Value will only increment by 1 and since my loop has to run for 265 times 100/265 gives me a value of 0.377, the value is not getting incremented by this decimal value.
Could you suggest me a logic so that I can show the Progress to the user with 265 iterations when ProgresBarInfo Minimum as 0 and Maximum values as 100?
Any suggestions are highly appreciated.
Hello,
Thank you for posting. Try to set its maximum values to 265 and so that instead of getting a decimal value you will get integer and value keep incrementing.
Please let me know if it helps or needs further assistance.
Thank you Divya.
Setting the maximum value to 265 will surely increment the ProgressBarInfo value, but I do not want the user to see that the loop runs for 265 times. The value should be displayed between 1-100 when though the loop runs for 265 times. Its like process running and the user wants to see how much % of processing is left.