private void txtEntrada_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(txtEntrada.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 (Ent.Consulta(int.Parse(txtEntrada.Text))) { BuscaDadosClasse(); gpoDados.Enabled = true; txtData.Focus(); } else { MessageBox.Show("Orçamento não Encontrado !"); txtEntrada.Focus(); } } } }