Checking input in Winforms

In the good old MFC, DDX routines would be built in validation for form entries. For example, it was possible to automatically check whether a user was entered into a string in a text field intended for entering numerical data.

Is there such a mechanism in Winforms? Obviously, you can add handlers for onChange events, etc. And do the processing there, but I ask if there is any built-in mechanism.

thanks

+3
source share
3 answers

You can certainly implement your own ValidatingTextBox with a Regex property, approved essentially every time you decide you want to be confirmed (keystrokes, Enter key, loses focus, ...)

, .

+3

ASP.NET Windows. Billy Hollis

+3

No, I don’t think so, but you can easily get a custom text block that applies the required validation based on a parameter or property set on its instance. Then you will have a built-in mechanism .; -)

0
source

Source: https://habr.com/ru/post/1702432/


All Articles