The Progress bar (Rollbar) does not complete before reaching the maximum, even though I have made an if statement that will only return it once complete.
[EDIT: I tried David Heffernan's answer and now it almost reaches end but not quite.]
I know the if statement looks weird but that's how I interpreted the answer
private void Bartimer_Tick(object sender, EventArgs e)
{
if (Rollbar.Value == 1000)
{
Rollbar.Value = 1000;
Rollbar.Increment(-1);
Rollbar.Value = 0;
Bartimer.Stop();
}
else
{
Rollbar.Increment(1);
}
}
private void Rollbtn_Click(object sender, EventArgs e)
{
Rollbar.Minimum = 0;
Rollbar.Maximum = 1000;
Bartimer.Start();
}
I have a feeling that it has something to do with the animation speed or timer interval.
I have also approached this in different ways already by trying to stop the timer after the bar reaches 0 but nothing changes.
Any suggestions would be appreciated.