Search Tools Links Login

Numerical input into text box (1 line of code)


Visual Basic 6, or VB Classic

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

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 96 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.