C sharp validating
For example, if the ‘Update User Name’ method is part of an API, that is used from an external application.
If you do not set the Cancel property, Windows Forms will assume that validation succeeded for that control, and raise the Validated event.
The way to validate the user input fields varies between applications and used technology and is beyond the scope of this blog post.
Depending on the project at hand, there are many approaches to validating data inputs.
Windows Forms provides several ways for you to validate input in your application.
If you need to require users to enter data in a well-defined format, such as a telephone number or a part number, you can accomplish this quickly and with minimal code by using the Masked Text Box control.