Total Pageviews

Friday, October 14, 2016

Restrict TextBox only to Numeric Input

Private Sub TextBox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox1.KeyPress
    Select Case e.KeyChar
    Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", vbBack
        e.Handled = False
    Case Else
        e.Handled = True
    End Select
End Sub

No comments:

Post a Comment