Answer the question
In order to leave comments, you need to log in
How to correctly write a condition for backspace?
Everything works fine with numbers. And the backspace still does not understand. I also tried to write 'Back'
if ((e.KeyChar == (char)Keys.Enter) || (e.KeyChar < (char)Keys.D0 || e.KeyChar > (char)Keys.D9) || (e.KeyChar == 8))
{
e.Handled = true;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question