New in version 6.3.0: See the new features.

Execute validation and lose focus on input/dialog before close event (sys.ValidateOnClose)


Send validate and lose focus events before close event during dialog and input commands

When active (set non-zero) any close event received during a dialog or input (caused by pressing a window close button) will be deferred until the current control’s validation and lose focus events have been executed. This means that a validation or lose focus event may prevent the close event.

In order to prevent situations where a validation fails and the close event is never reached (sys.ValidateOnClose is greater than zero), the value of sys.ValidateOnClose is decremented by 1 every time the window close button is clicked. If the value reaches 0, the normal close event is then executed before any validation or lose focus event.

If the validation and lose focus events are always be executed, sys.ValidateOnClose must be set to a negative number.

If the validate and lose focus events are being executed because the close button has been pressed, the variable sys.ClosePending returns TRUE to indicate that there is a pending close window event.

By default, sys.ValidateOnClose is 0.




Data validation

Fields - validation