private void FormVisibleChangedHandler(object sender, EventArgs e) { if (mdi_container == null) { return; } if (form.Visible) { mdi_container.ActivateChild(form); } else if (mdi_container.Controls.Count > 1) { mdi_container.ActivateActiveMdiChild(); } }
private void MdiWindowClickHandler(object sender, EventArgs e) { Form mdichild = (Form)mdilist_items [sender]; // people could add weird items to the Window menu // so we can't assume its just us if (mdichild == null) { return; } mdicontainer.ActivateChild(mdichild); }