by Mark Anthony Dinglasa (13 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 5.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (4 Votes)
Do you want to input only numbers in a textbox? and just want a few lines of code ?Well this code is for you....See it for yourself....Want to know more of my codes then email me....
'In the KeyPress event of a textbox
'Shall we say you have put one textbox in your form
'Here it goes
Private Sub text1_KeyPress(Keyascii as Integer)
Select case Keyascii
case asc(vbcr)
Keyascii=0
case 8,46
case 47 to 58
case else
Keyascii=0
End Select
End Sub