Reputation: 33
I have the following code in my project:
{
Lib.Settingsform f = new Lib.Settingsform();
f.Show();
LoadSettings();
InitializeInterface();
}
I want to call above methods after f.Show()
when the form closes but they run at the same time.
What am I doing wrong?
Upvotes: 0
Views: 989
Reputation: 1802
I believe you want to use ShowDialog()
using (Lib.Settingsform f = new Lib.Settingsform())
f.ShowDialog();
LoadSettings();
InitializeInterface();
This will block the thread until the form is closed.
Upvotes: 1