Set the Maximum
property of the ProgressBar
:
Gets or sets the maximum value of the range of the control. The default is 100.
So in your original code, you could do:
p.Maximum = 10;
counter += 1;
progressBar1.Value = counter;
label9.Text = counter.ToString();
label9.Visible = true;
if (counter == 10)
And in your updated code, change the Maximum
to 60 and keep (almost) everything else the same:
p.Maximum = 60;
counter += 1;
progressBar1.Value = counter;
label9.Text = counter.ToString();
label9.Visible = true;
if (counter == 60)