VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Get only numbers in Text Box

by Nagendran (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 16th January 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Get only numbers in Text Box

API Declarations


'Insert a Text Box in a Form and named as TxtNumber

Rate Get only numbers in Text Box



Private Sub TxtNumber_KeyPress(KeyAscii As Integer)
  Select Case KeyAscii
    Case 48 To 57, 8             ' Numbers 0 to 9 and Backspace key
    Case Else: KeyAscii = 0
  End Select
End Sub


Download this snippet    Add to My Saved Code

Get only numbers in Text Box Comments

No comments have been posted about Get only numbers in Text Box. Why not be the first to post a comment about Get only numbers in Text Box.

Post your comment

Subject:
Message:
0/1000 characters