garethh86
asked on
Key Press backspace not working!
Hi there
Please see code below, trying to although the user to enter numbers but not characters which works perfectly, the backspace key doesn't work though! DEL works, have even added in the ascii code for backspace (8) and allowed it to handle key press, doesn't work at build though!
ANy ideas where it's going wrong?
Thanks!
Please see code below, trying to although the user to enter numbers but not characters which works perfectly, the backspace key doesn't work though! DEL works, have even added in the ascii code for backspace (8) and allowed it to handle key press, doesn't work at build though!
ANy ideas where it's going wrong?
Thanks!
If e.KeyChar >= Chr(48) And e.KeyChar <= Chr(57) Then
e.Handled = False ' works!
'added this line to see if it work, but doesn't!
ElseIf e.KeyChar = Chr(8) Then ' 8 is Backspace
e.Handled = True
Else
e.Handled = True
End If
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER