private void toolStripMenuItem2_Click(object sender, EventArgs e) { listeEnfants liste_form = new listeEnfants(); listeEnfants childForm = null; foreach (Form f in this.MdiChildren) { if (f is listeEnfants) { childForm = (listeEnfants)f; break; } } if (childForm != null) { childForm.Show(); childForm.Focus(); MessageBox.Show("Fenêtre \"" + childForm.Text + "\" déjà ouverte."); } else { childForm = new listeEnfants(); childForm.MdiParent = this; childForm.Show(); childForm.Focus(); } }
private void toolStripMenuItem2_Click(object sender, EventArgs e) { listeEnfants liste_form = new listeEnfants(); listeEnfants childForm = null; foreach (Form f in this.MdiChildren) { if (f is listeEnfants) { childForm = (listeEnfants)f; break; } } if (childForm != null) { childForm.Show(); childForm.Focus(); MessageBox.Show("Fenêtre \"" + childForm.Text + "\" déjà ouverte."); } else { childForm = new listeEnfants(); childForm.MdiParent = this; childForm.Show(); childForm.Focus(); } }