N
N
Nik_Haker2015-01-23 19:54:41
Programming
Nik_Haker, 2015-01-23 19:54:41

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

3 answer(s)
D
Don Kaban, 2015-01-23
@donkaban

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.

V
Vitaly, 2015-01-23
@vt4a2h

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.

A
AxisPod, 2015-01-28
@AxisPod

There is no "edit" in C++. First, learn to ask questions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question