OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Range Validator Class

TRangeValidator is a range validator derived from TFilterValidator.

It accepts only numbers and adds range checking on the final result.

The constructor takes two parameters that define the minimum and maximum valid values:

TRangeValidator(long minValue, long maxValue);

The range validator constructs itself as a filter validator that accepts only the digits 0 through 9 and the plus (+) and minus (-) characters. The inherited TRangeValidator::IsValidInput, therefore, ensures that only numbers filter through. TRangeValidator then overrides TRangeValidator::IsValid to return true only if the entered numbers are a valid integer within the range defined in the constructor. The TRangeValidator::Error method displays a message box indicating that the entered value is out of range.

See Also