private void button1_Click(object sender, EventArgs e)
{
progressBar1.Maximum = 100;
progressBar1.Value = 0;
progressBar1.Step = 5;
for (int i = 0; i < 20; i++)
{
System.Threading.Thread.Sleep(1000);
progressBar1.Value += progressBar1.Step;
}
}