//Construtor public FormGridFuncao(FormCadFuncao frm1) { InitializeComponent(); bd = new BancoDados(); frm = frm1; tbPesquisa.Focus(); }
private void cargosEFunçõesToolStripMenuItem_Click(object sender, EventArgs e) { bool open = false; foreach (Form frm in this.MdiChildren) { if (frm is FormCadFuncao) { frm.BringToFront(); open = true; } } if (!open) { frmFuncao = new FormCadFuncao(this); frmFuncao.Show(); } }