by Pavan Chawda (1 Submission)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 24th March 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Simple code to allow only characters to be typed into a textbox without using any API's ."DELETE", "BACKSPACE","SPACE" AND "." keys also work.
'Simple code to allow only characters to be typed into a textbox without
'using any API's ."DELETE", "BACKSPACE","SPACE" AND "." keys also work. Nothing
'happens when numbers are typed.
'code
Private Sub Text1_KeyPress(KeyAscii As Integer)
'ascii 8 stands for-backspace,46-delete ,32-space,65-90 stands for A to Z and 97-122 stands for a to z
If KeyAscii <> 8 And KeyAscii <> 46 and KeyAscii <>32 And KeyAscii < 65 Or KeyAscii > 90 And KeyAscii < 97 Or KeyAscii > 122 Then
KeyAscii = 0
End If
End Sub
No comments have been posted about Simple code to allow only characters to be typed into a textbox without using any API's .DELETE, . Why not be the first to post a comment about Simple code to allow only characters to be typed into a textbox without using any API's .DELETE, .