private void consultarToolStripMenuItem_Click(object sender, EventArgs e) { Form frmCliente = this.MdiChildren.FirstOrDefault(i => i is FrmConta); if (frmCliente == null) { frmCliente = new FrmConta() { MdiParent = this }; // test } frmCliente.Focus(); }
private void consultarToolStripMenuItem_Click(object sender, EventArgs e) { try { Form frmCliente = this.MdiChildren.FirstOrDefault(i => i is FrmConta); if (frmCliente == null) { frmCliente = new FrmConta() { MdiParent = this }; } frmCliente.Focus(); } catch (Exception) { MessageBox.Show("Falha na aplicação!", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } }