I\'m attempting to detect, on the MDI parent, when my MDI child form closes, and react accordingly. The MDI parent shouldn\'t do anything until the MDI child closes. Here is
Don't use the Closed
Event. Instead, use the FormClosing
event:
private void frmMain_FormClosing(object sender, FormClosingEventArgs e){
if (MessageBox.Show("Are you sure you want to Exit", "Confirmation", MessageBoxButtons.YesNo,MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.No) {
e.Cancel = true;
}
}