private void cmdNew(object sender, EventArgs e) { // Show a new child form. Child frmChild = new Child(); frmChild.MdiParent = this; frmChild.RefreshText(synchronizedText); mdiIndex++; frmChild.Text = "MDI Child #" + mdiIndex.ToString(); frmChild.Show(); }
public void RefreshChildren(Child sender, string text) { // Store text for use when creating a child form, or if needed later. synchronizedText = text; // Update children. foreach (Child frm in this.MdiChildren) { if (frm != sender) { frm.RefreshText(text); } } }