Esempio n. 1
0
 private void atividade3ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (Application.OpenForms.OfType <frmExercicio3>().Count() <= 0)
     {
         frmExercicio3 frm3 = new frmExercicio3();
         frm3.Show();
     }
 }
Esempio n. 2
0
        private void exercicio3ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form fc = Application.OpenForms["frmExercicio3"];

            if (fc != null)
            {
                fc.Close();
            }
            frmExercicio3 FrmExercicio3 = new frmExercicio3();

            FrmExercicio3.MdiParent   = this; // anexar o form 'filho' dentro do form 'pai'
            FrmExercicio3.WindowState = FormWindowState.Maximized;
            FrmExercicio3.Show();
        }