This documentation is archived and is not being maintained.

Visual Basic Reference

Visual Studio 6.0

Validate Event

See Also    Example    Applies To

Occurs before the focus shifts to a (second) control that has its CausesValidation property set to True.


Private Sub object_Validate(KeepFocus As Boolean)

The Validate event syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
KeepFocus Value that determines if the control loses focus. Setting KeepFocus to True specifies that the control retains the focus.


The Validate event works in tandem with the CausesValidation property to prevent a control from losing the focus until certain criteria are met.

Important   The Validate event only occurs when the control which is about to receive the focus has its CausesValidation property set to True.