try to using ascii then trap when key press.
Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
try this following code, this code didn't allowed you to input any special character just numbers and letters:
Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 65 To 90, 48 To 57, 8 ' A-Z, 0-9 and backspace
'Let these key codes pass through
Case 97 To 122, 8 'a-z and backspace
'Let these key codes pass through
Case Else
'All others get trapped
KeyAscii = 0 ' set ascii 0 to trap others input
End Select
End Sub
Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
please help i want my textbox phoneno to allow only numbers and only 10 numbers to b allowed please guide me using VB.NET 2008
harshi sarvaiya..make your own thread here .
There are many members will help you more..
Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444