Set the Parent of a Form

i would do something like this:

SavingForm saving = new SavingForm();
savingForm.ShowDialog(this);

In SavingForm i would start a timer in the load handler that runs for 500 milliseconds and then closes the form when done. Cleaner that way. ShowDialog will also lock your UI to only display the saving form and not allow the user to monkey with anything.


Use this:

saving.Show(this);

To set the Owner when you show the form.

Edit: The ShowDialog() method also has an overload that let's you specify the owner if that is the route you decide to go:

saving.ShowDialog(this);

Tags:

C#

Winforms