private void txtOrcamento_KeyPress(object sender, KeyPressEventArgs e) { Fun.AnalisaInteiro(e); // NAO DEIXA QUE O CAMPO RECEBA LETRAS / CARACTERES ESPECIAIS if (e.KeyChar == 13) // TECLA 13 (ENTER) { e.Handled = true; // OMITI O BEEP DA TECLA ENTER if (string.IsNullOrEmpty(txtOrcamento.Text)) { wp_Incluir = true; // VARIAVEL DE CONTROLE PRA INFORMAR SE É PRA INCLUIR OU ALTERAR gpoDados.Enabled = true; // HABILITAR A GROUPBOX (GPODADOS) PARA ACESSAR OS CAMPOS txtData.Focus(); // ENVIA O FOCO DO FORMULARIO PARA O CAMPO TXTDATA; } else { wp_Incluir = false; // ALTERAÇÃO if (Orc.Consulta(int.Parse(txtOrcamento.Text))) { BuscaDadosClasse(); gpoDados.Enabled = true; txtData.Focus(); } else { MessageBox.Show("Orçamento não Encontrado !"); txtOrcamento.Focus(); } } } }
private void txtOrcamento_KeyPress(object sender, KeyPressEventArgs e) { Fun.AnalisaInteiro(e); if (e.KeyChar == 13) { e.Handled = true; if (string.IsNullOrEmpty(txtOrcamento.Text)) { wp_Incluir = true; gpoDados.Enabled = true; txtData.Focus(); } else { wp_Incluir = false; if (Orc.Consulta(int.Parse(txtOrcamento.Text))) { BuscaDadosClasse(); gpoDados.Enabled = true; txtData.Focus(); } else { MessageBox.Show("Orçamento não Encontrado !"); txtOrcamento.Focus(); } } } }