private void textBox5_Leave(object sender, EventArgs e) { try { if (textBox5.Text != "") { this.Hide(); FrmSolucoes sol = new FrmSolucoes(textBox5.Text); sol.Show(); } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString(), "Erro Txt5 Leave", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void textBox5_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { if (textBox5.Text != "") { this.Hide(); FrmSolucoes sol = new FrmSolucoes(textBox5.Text); sol.Show(); } } else if (e.KeyCode == Keys.Tab) { if (textBox5.Text != "") { this.Hide(); FrmSolucoes sol = new FrmSolucoes(textBox5.Text); sol.Show(); } } } catch (Exception ex) { MessageBox.Show(ex.Message.ToString(), "Erro Txt5 Key Down", MessageBoxButtons.OK, MessageBoxIcon.Error); } }