How do I make a form modal in Windows Forms?
Use Form.ShowDialog()
As Bob mentioned, you should set Form.DialogResult
accordingly on your modal form.
Form f = new Form();
f.ShowDialog(this);
Use the ShowDialog()
method instead of Show()
when you display the child form.