Ejemplo n.º 1
0
 public bool ValidaCampo()
 {
     if (txtForma.Text.Trim().Length > 100)
     {
         MessageBox.Show("Não é possivel inserir esta forma", "Informe a forma com menos de 100 caracteres!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtForma.Focus();
         return(false);
     }
     if (String.IsNullOrEmpty(txtForma.Text))
     {
         MessageBox.Show("Faltou informar a forma", "Informe a forma!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtForma.Focus();
         return(false);
     }
     if (!MaskForm.ValidaTexto(txtForma.Text))
     {
         MessageBox.Show("Forma invalida", "Forma não pode conter numeros!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         txtForma.Focus();
         return(false);
     }
     return(true);
 }