Vb validating


13-Aug-2020 17:17

In such cases, you can force the controls in the support library to behave more closely to the original VB6 controls by setting the VB6Config.Focus Event Support static property to True: When this property is True, the support library ensures that the Lost Focus event is always fired after the Validate event.

vb validating-43

muslem dating service

Within your "Accept" button click handler (the "save" button) process each control that Causes Validation to ensure that they are all valid... (Assuming you are not placing conflicting date in there by the program) It will be executed as that control looses the focus. Cor Phill, Now I understood you, in fact do you want to check if they are not empty?

The Validate event fires whenever the user attempts to set focus to another field on the same form or when the form unloads from memory while the current field has focus.

A programmer can evaluate the state of the data at that point and react to any error in the data either by: Listing 5.4 illustrates the use of the Validate event procedure to perform validation and to decide whether or not to keep focus on the current control.

Notice that in the previously described scenario – the end user moves the focus away with the mouse but the control fails to validate – then a pair of Lost Focus/Got Focus events is fired anyway (unlike VB6), but this is seldom a problem.

We recommend that you don’t set the Focus Event Support property to True unless really necessary, because this setting adds overhead to the standard event dispatching process and might cause other minor annoyances.

The Validate event and the accompanying Causes Validate property are new to VB6 and give programmers a much-needed replacement for older, more cumbersome techniques of field validation.