Is there an event I can use to tell if a child form has been added or removed from the MDI parent?
Wire up the MdiChildActivate event and keep a list of recognized children. When a new form is activated, also wire up the FormClosed event.
MdiChildActivate
FormClosed
private List ChildFormList = new List(); private void MyForm_MdiChildActivate(object sender, EventArgs e) { Form f = this.ActiveMdiChild; if (f == null) { //the last child form was just closed return; } if (!ChildFormList.Contains(f)) { //a new child form was created ChildFormList.Add(f); f.FormClosed += new FormClosedEventHandler(ChildFormClosed); } else { //activated existing form } } private void ChildFormClosed(object sender, FormClosedEventArgs e) { //a child form was closed Form f = (Form)sender; ChildFormList.Remove(f); }