Search code examples
c#mdichildmdiparent

MDI Child Forms C#


How do you check for a close event for an MDI child form when clicking the "X" button and let the parent form know that it has closed?


Solution

  • You can simply listen to the FormClosed event in the MDI.

    var childForm = new ChildForm();
    childForm.FormClosed += new FormClosedEventHandler(form_FormClosed);
    childForm.Show();