How to disable the parent form when a child form is active?
Have you tried using Form.ShowDialog() instead of Form.Show()?
ShowDialog shows your window as modal, which means you cannot interact with the parent form until it closes.
Are you calling ShowDialog()
or just Show()
on your child form from the parent form?
ShowDialog
will "block" the user from interacting with the form which is passed as a parameter to ShowDialog
.
Within the parent you might call something like:
MyChildForm childForm = new MyChildForm();
childForm.ShowDialog(this);
where this
is the parent form.
Its simple, use
Form.ShowDialog();
Instead of
Form.Show();
While using Form.ShowDialog()
, you cannot interact with the parent form until it closes.