Numerical input into text box (1 line of code)
![Visual Basic 6, or VB Classic Visual Basic 6, or VB Classic](https://www.fortypoundhead.com//assets/img/icons/v7/vb6.png)
With this 1 line of code you can strip non-numerical input into text boxes.
Original Author: Kenneth Gilbert Jr.
Code
Private Sub Text1_KeyPress(KeyAscii As Integer)
' Force numbers only in a text box
If IsNumeric(Chr(KeyAscii)) <> True Then KeyAscii = 0
End Sub
Loading Comments ...
Comments
No comments have been added for this post.
You must be logged in to make a comment.