C windows form validating event
Next step is to choose the way Super Validator performs validation.
That is done by setting Validation Type property as shown in image below: These properties allow you to define 3 level validation for each control.
Note: the validation events do not fire if the editor's Causes Validation property is set to false.
By default when the editor fails validation an error icon with a tooltip is displayed.
In some cases, however, you may want to provide manual validation control (limit the range of valid values, implement a conditional validation mechanism, etc). If the value entered doesn't meet your restrictions or is of the wrong type, you can indicate that the current value has failed validation. Validating event is raised when an end-user attempts to accept the edited value.
This occurs in the following cases: To indicate that the edit value has failed validation set the event's Cancel parameter to true.
You can assign one of these properties or all of them if you need to perform multi-level validation.
When using masks in editors the entered value is automatically checked against the mask first. For instance, when the editor's Mask Properties.
Ignore Mask Blank property is set to false and the value has only been partially entered (not all the placeholders in the mask are filled) the value will fail validation when an end-user tries to leave the editor. Validating event will be fired as a result and its Cancel parameter is set to true by default.
This behavior was achieved by dragging an Error Provider component onto the dialog and handling the Validating event like so: Notice the call to Error Provider.
Set Error, passing in the control the error is associated with (which we get from the sender argument to the Validating event), along with the error string, which will be used as the tool tip.
NET designer all settings that you make are actually translated into the code that you can find in Initialize Component() method of your form. Container Control = my Parent Form super Validator1. If you wish to use custom error provider to display validation errors in your application you can do so by implementing IError Provider interface.