Problem : progressForm.ShowDialog()
waits untill unless the form is closed to execute the further statements. so the statements after the progressForm.ShowDialog()
will not get executed untill the Form is closed.
Solution: You need to call progressForm.Show()
which will not block the program flow.
as it will open the progressForm independently so the statements after the progressForm.Show()
also get executed withoutwaiting for anything.
From MSDN: Form.ShowDialog()
You can use this method to display a modal dialog box in your application. When this method is called, the code following it is not executed until after the dialog box is closed.
Replace This:
progressForm.ShowDialog();
With This:
progressForm.Show();