ComponentOne True DBInput Pro 8.0
InvalidRange Event (TDBDate)

 

Reference> TDBDate Control> TDBDate Control Events> InvalidRange Event (TDBDate)

InvalidRange Event (TDBDate)

The InvalidRange event occurs when the user tries to move the focus away from the control when the entered value is not within the range specified in the control's minimum and maximum properties. The entered value must be valid.

Syntax

control_InvalidRange (Restore As Boolean)

Arguments

restore is a Boolean value that determines whether to restore the value when moving the focus away from the control.

The possible values for restore are as follows:

True - Restores the old valid value. (Default)

False - Clears the content in the control.

Remarks

If the restore argument is set to True (default), the underlying value will be restored to the old value when the control receives the focus. If set to False, the control will be cleared, setting its value to Null. However, if the focus is set back to control, the restore argument will be ignored, and the control will display the invalid value just as it was with its old selection setting. If you want to modify the underlying value, you must set the Value, Number or the Text properties.

The TDBDate control allows you to enter any valid date while the control has the focus, including dates that exceed the MaxDate and MinDate property. There will be no range checking for the entered date. But as soon as the user attempts to move the focus away, the InvalidRange event will be fired notifying that the entered date was out of range.

The TDBNumber control allows you to enter any numeric values that are within the number of digits specified in the Format property, both positive and negative regardless to the MaxValue and the MinValue properties. There will be no range checking for the entered value until you move the focus away. As soon as the control loses the focus, the InvalidRange event will be invoked notifying the user that the entered value was out of range.

The TDBTime control allows you to enter any valid time while the control has the focus, including times that exceed the MaxTime and MinTimeproperty. There will be no range checking for the entered time. But as soon as the user attempts to move the focus away, the InvalidRange event will be fired notifying that the entered time was out of range.

Notes

When modifying values by changing the Value, Number, or the Text properties that are not within the proper range, this will cause an invalid range error to occur. No events are fired in this case.

When binding the control to a data source, if the retrieved values exceed the specified range, the DBError event will be fired, returning an error code - 1.

See Also

Format Property (TDBDate)

Format Property (TDBTime)

Value Property (TDBDate)

Value Property (TDBNumLite)

Value Property (TDBTime)

Number Property (TDBDate)

Text Property (TDBDate)

Text Property (TDBNumLite)

Text Property (TDBTime)

MaxDate Property (TDBDate)

MinDate Property (TDBDate)

DBError Event (TDBDate)

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback