It appears to be a big change if i were to change it from On Change to something like Lost Focus of the control ...
The reason i ask is business really doesn't like the validation messages appearing suddenly even while the user hasn't finished filling in the field ... filling in a "Password" control, the user is suddenly shown validation errors while they're typing ...
Each control has the following events and properties that are used to validate a form. Validation on a control is triggered when the control loses focus. Cancel Event Args] object as a parameter to the event block, which you can access this by using the in the Validating event, all events that would usually occur after the Validating event are suppressed.
Use this event to provide custom validation for any input control, such as a Text Box. In other words, the validating control will retain the focus until the user provides the correct format, even if the user clicks another control such as a button or textbox.
When an application encounters an unexpected situation (such as a missing file or input parameter) or a logical error (performing a division-by-zero operation, for example), by default the application will terminate and generate an error display like the one shown in Figure 3.1. NET displays an error message and terminates the application when any error occurs.
A good user interface will validate user input to ensure it is in the correct format.
Anyone got a nice solution for hiding validation messages and only showing them once they tab off the control ?! So the class valid/dirty/invalid seems nice (I guess you can agree with the decorator that say the field is not yet compliant).
In this chapter, we'll look at two facets of dealing with problems in . First, we'll demonstrate the programming that you can do to handle errors, allowing the user to make corrections when something goes wrong.VB6 controls fire the Validate event first and then the Lost Focus event; if the Validate sets Cancel=True, then the Lost Focus event is never fired.The sequence is the same regardless of how the end user moves the input focus away from the control. NET controls fire these events in the same sequence only if end users move the input focus by means of the keyword; if they use the mouse, the control fires a Lost Focus event, then the Validating event, and – if the validation fails – another Got Focus event to let the application know that the focus is again on the control. NET programs created by VB Migration Partner follow the . In most cases, the fact that the Lost Focus event fires before the Validate event doesn’t affect the application negatively. You will first see the programming you can use to handle errors, and then you will see how to use validation techniques to prevent bad data from being entered into your application in the first place.But in the real world, you need to handle unexpected problems when your code is running.