Hi,
This is the simple way of doing.using background worker also we can do...i hope it will help you...
private void button1_Click(object sender, EventArgs e)
{
progressBar1.Minimum = 0;
// Sets the progress bar's maximum value to a number representing
// all operations complete -- in this case, all five files read.
progressBar1.Maximum = 500;
// Sets the Step property to amount to increase with each iteration.
// In this case, it will increase by one with every file read.
progressBar1.Step = 1;
// Uses a for loop to iterate through the operations to be
// completed. In this case, five files are to be copied into memory,
// so the loop will execute 5 times.
for (int i = 0; i <= 500; i++)
{
// Inserts code to copy a file
progressBar1.PerformStep();
if (i <= 200)
{
// Updates the label to show that a file was read.
label1.Text = "reading tools";
}
else if (i <= 499)
{
label1.Text = "exporting files";
}
else
{
label1.Text = "finished";
}
}
}
Best Regards,
C.Gnanadurai
-----------------------
Please mark the post as answer if it is helpfull to you