ComponentOne Basic Library for UWP
Basic Library Overview / Input for UWP / Working with Input for UWP / Working with C1NumericBox / Input Validation
In This Topic
    Input Validation
    In This Topic

    You can use the C1NumericBox.Minimum and C1NumericBox.Maximum properties to set a numeric range that users are limited to at run time. If the C1NumericBox.Minimum and C1NumericBox.Maximum properties are set, users will not be able to pick a number larger than the C1NumericBox.Minimum or smaller than the C1NumericBox.Maximum.

    When setting the C1NumericBox.Minimum and C1NumericBox.Maximum properties, the C1NumericBox.Minimum should be smaller than the C1NumericBox.Maximum. Also be sure to set the C1NumericBox.Value property to a number within the C1NumericBox.Minimum and C1NumericBox.Maximum range.

    You can also choose a mode for range validation using the C1NumericBox.RangeValidationMode property. This property controls when the entered number is validated. You can set C1NumericBox.RangeValidationMode to one of the following options:

    Option

    Description

    Always

    This mode does not allow users to enter out of range values.

    AlwaysTruncate

    This mode does not allow users to enter out of range values. The value will be truncated if the limits are exceeded.

    OnLostFocus

    This mode truncates the value when the control loses focus.

    See Also