private void atividade5ToolStripMenuItem_Click(object sender, EventArgs e) { if (Application.OpenForms.OfType <frmExercicio5>().Count() <= 0) { frmExercicio5 frm5 = new frmExercicio5(); frm5.Show(); } }
private void exercicio5ToolStripMenuItem_Click(object sender, EventArgs e) { Form fc = Application.OpenForms["frmExercicio5"]; if (fc != null) { fc.Close(); } frmExercicio5 FrmExercicio5 = new frmExercicio5(); FrmExercicio5.MdiParent = this; // anexar o form 'filho' dentro do form 'pai' FrmExercicio5.WindowState = FormWindowState.Maximized; FrmExercicio5.Show(); }