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