private void btClearCat_Click(object sender, EventArgs e) { frmCadastroFuncionario f = new frmCadastroFuncionario(); f.Show(); this.Close(); }
private void funcionárioToolStripMenuItem_Click(object sender, EventArgs e) { if (Application.OpenForms.OfType <frmCadastroFuncionario>().Count() > 0) { MessageBox.Show("Este formulário já está aberto!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { frmCadastroFuncionario objCad = new frmCadastroFuncionario(); //objCad.MdiParent = this; objCad.Show(); } }