A
A
Alexander Sitnik2016-03-04 14:47:10
C++ / C#
Alexander Sitnik, 2016-03-04 14:47:10

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

1 answer(s)
A
Anton Fedoryan, 2016-03-04
@AnnTHony

stackoverflow.com/questions/10288939/how-can-i-det...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question