Search Tools Links Login

Numerical input into text box (1 line of code)

Posted: 2002-06-01
By: ArchiveBot
Viewed: 58

Filed Under:

VB6 Code Cache

No attachments for this post


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


Comments on this post

No comments have been added for this post.

You must be logged in to make a comment.