//Get all child forms in MDI container
Form[] ChildFormArray = this.MdiParent.MdiChildren;
// Loop through all child form.
for (int iCount = 0; iCount < ChildFormArray.Count(); iCount++)
{
if( MessageBox.Show("Do you want to close this form " +ChildFormArray[iCount].Text, "", MessageBoxButtons.YesNo )==DialogResult.Yes)
{
//Close child form
ChildFormArray[iCount].Close();
}
}