VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Accept only numbers in a text box control with one line of code UPDATED MUST SEE

by Marco Antonio Alves (3 Submissions)
Category: Coding Standards
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (7 Votes)

first, my apologies for my bad english. hehe.
i updated my code to accept only numbers in a textbox. removed the bug of the another code. sorry by the another. hehe. but this code work

Rate Accept only numbers in a text box control with one line of code UPDATED MUST SEE

type code bellow into a keypress event of a textbox control
KeyAscii = IIf(Not KeyAscii = 8 And Not IsNumeric(Chr(KeyAscii)), 0, KeyAscii)

Download this snippet    Add to My Saved Code

Accept only numbers in a text box control with one line of code UPDATED MUST SEE Comments

No comments have been posted about Accept only numbers in a text box control with one line of code UPDATED MUST SEE. Why not be the first to post a comment about Accept only numbers in a text box control with one line of code UPDATED MUST SEE.

Post your comment

Subject:
Message:
0/1000 characters