Exemple #1
0
 private void aTIVIDADE2ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (Application.OpenForms.OfType <frmExercicio2>().Count() <= 0)
     {
         frmExercicio2 frm2 = new frmExercicio2();
         frm2.Show();
     }
 }
Exemple #2
0
        private void exercicio2ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form fc = Application.OpenForms["frmExercicio2"];

            if (fc != null)
            {
                fc.Close();
            }
            frmExercicio2 FrmExercicio2 = new frmExercicio2();

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