Possible Duplicate:
Winforms Progress bar Does Not Update (C#)
First time asking a question here for me.
I'll try to explain my problem using this code snippet:
progressBar1.Maximum = 50;
for (int i = 0; i < 50; i++)
{
progressBar1.Value++;
}
MessageBox.Show("Finished");
progressBar1.Value = 0;
The problem with this code is that the MessageBox pops up at the time the for loop is finished, not when the progressbar has finished drawing. Is there any way to wait until the progressbar has finished drawing before continuing?
Thanks guys!