3
Reply

Trapping backspace character key presses?

S4E

S4E

Sep 21 2004 4:28 AM
6.9k
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)