Answer the question
In order to leave comments, you need to log in
How to prevent characters from being typed in an edit in C++?
For example, so that a person could enter only 1 and 0 into an edit, and all other characters and letters and numbers could not?
Answer the question
In order to leave comments, you need to log in
You are obviously using some kind of GUI library, because C++, as a language, knows nothing about any "these"'s. Unfortunately, all telepaths are on vacation due to the crisis.
Do you really think that there is only one GUI library for pluses? What is used for the GUI, what edit? Where is the sample code with your attempts to solve this problem?
And so, here's a general answer for you: a validator or a parameter that stores the character code in the keypress event handler. Then think (well, at least once, plz, just try it - it's not difficult and even interesting) yourself.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question