N
N
neitoo2022-02-27 15:04:25
C++ / C#
neitoo, 2022-02-27 15:04:25

How to handle invalid input in textbox?

I have several textboxes in my project for entering data, when a button is pressed, this data is written to another textbox, and it is necessary to validate the entered data.
For example, you need to enter a number, but so that it does not contain 0 or an empty field at all.
I tried to make the button inactive until the condition described above is met, but when entering data, it remained inactive.
Tell me, how can I make it so that when the button is pressed and the data is entered incorrectly, they are not sent to another text box? Or other implementation options ..
If you need some code fragment, then I'll throw it off.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
#
#, 2022-03-01
@neitoo

https://www.c-sharpcorner.com/blogs/how-to-use-val...

K
kokapuk, 2022-02-27
@kokapuk

Textboxes have a TextChanged event, write your condition there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question