viernes, 14 de febrero de 2020

validar entradas en los campos preskey

Private Sub tbcodigomodulo_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbcodigomodulo.KeyPress
        If Char.IsLetter(e.KeyChar) Then
            e.Handled = False
        ElseIf Char.IsControl(e.KeyChar) Then
            e.Handled = False
        ElseIf Char.IsSeparator(e.KeyChar) Then
            e.Handled = False
        Else
            e.Handled = True
        End If
    End Sub

    Private Sub tbDescModulo_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbDescModulo.KeyPress
        If Char.IsLetter(e.KeyChar) Then
            e.Handled = False
        ElseIf Char.IsControl(e.KeyChar) Then
            e.Handled = False
        ElseIf Char.IsSeparator(e.KeyChar) Then
            e.Handled = False
        Else
            e.Handled = True
        End If
    End Sub

    Private Sub tbcodtile_KeyPress(sender As Object, e As KeyPressEventArgs) Handles tbcodtile.KeyPress
'EN ESTA SINTAXIS SOLO PERMITE ESCRIBIR LETRAS ESPACIOS EN BLANCO Y CONTROLES
        If Char.IsLetter(e.KeyChar) Then
            e.Handled = False
        ElseIf Char.IsControl(e.KeyChar) Then
            e.Handled = False
        ElseIf Char.IsSeparator(e.KeyChar) Then
            e.Handled = False
        Else
            e.Handled = True
        End If
    End Sub

NOTA: EL FUNCIONAMIENTO DE ESTA INSTRUCCION, ES SE ACTIVA LA FUNCION O EVENTO PARA QUE NO ACEPTE LOS NUMEROS AL MOMENO DE ESCRIBIR.

No hay comentarios:

Publicar un comentario

Los mail de oulook no se pueden reenviar.

 cuando en el asunto poseen un caracter especial por ejemplo @#$ los correos no salen y no te muestra ningun correo de rebote, especialmente...