3
Answers

Trapping backspace character key presses?

S4E

S4E

20y
6.9k
1
This topic probably belong here, rather than the c# forum... When tying to allow only number into a text box, I added code which works BUT as a side effect, I cant actually use backspace anymore to delete typing errors :-( Any ideas on how to fix this? I want to trap the backspace to allow it. I tried stuff like: if(e.KeyChar.Equals(Keys.Back)) { ... } But this doesnt seem to work :-( Any ideas?
Answers (3)