In this tutorial, we are going to use three members of the Progressbar class:
Minimum, Maximum, and Value.
The value should range between the minimum and maximum.
Create a new C# Application. Add the following controls to the main form:
Progressbar control, name it as pb.
Timer, name it as tr

Paste the following code into the Form Load Event sub:
private void frmProgressbar_Load(object sender, EventArgs e)
{
pb.Minimum = 0; // set Minimum to 0
pb.Maximum = 100;// set Maximum t0 100
tr.Interval = 100;// timer ticks each 100 milliseconds
tr.Enabled = true; // start the timer
}
and the Timer Tick Event sub:
private void tr_Tick(object sender, EventArgs e)
{
if(pb.Value!=100) // check if value below 100 (should not be greater than the maximum value of the Progressbar
{
pb.Value += 5;// add 5 to the Progressbar current value
}
}
That's it!




