How To Make A TextBox Accept Only Numeric Values Using Visual Basic.Net
In This VB.Net Tutorial we will See How To Make A TextBox That Allow Only Number Characters On KeyPress Event using Visual Basic.Net Programming Language And Visual Studio IDE .
Project Source Code:
Public Class TextBox_Only_Number
Private Sub TextBox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox1.KeyPress
If Not Char.IsControl(e.KeyChar) AndAlso Not Char.IsDigit(e.KeyChar) Then
e.Handled = True
End If
End Sub
End Class
OUTPUT:
Download Projects Source Code