miércoles, 11 de octubre de 2017

Aceptar sólo números en un Textbox y otro caracter

Private Sub tbfecha_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles tbfecha.KeyPress
        If Not Char.IsControl(e.KeyChar) AndAlso Not Char.IsDigit(e.KeyChar) AndAlso (e.KeyChar <> "-") Then
            e.Handled = True
        End If
    End Sub

No hay comentarios.:

Publicar un comentario