KeyboardHighValue, KeyboardLowValue, SpinnerHighValue, SpinnerLowValue
These properties determine what values you can enter in a spinner using either the keyboard or the arrow buttons.
Usage |
spnSpinner.KeyboardHighValue = nValue nValue = spnSpinner.KeyboardHighValue spnSpinner.KeyboardLowValue = nValue nValue = spnSpinner.KeyboardLowValue spnSpinner.SpinnerHighValue = nValue nValue = spnSpinner.SpinnerHighValue spnSpinner.SpinnerLowValue = nValue nValue = spnSpinner.SpinnerLowValue |
Although they ultimately control the same thing (the maximum value the user can enter in the spinner), KeyboardHighValue has a lower maximum value than SpinnerHighValue: 2,147,483,647 versus who knows how high (we gave up after entering values up to 1.0 E+100). Assigning a value greater than 2,147,483,647 to KeyboardHighValue results in it being set to a negative number. Assigning an enormously high value to SpinnerHighValue doesn't mean you'll be able to spin up to a value that high. First, who'd have the patience? Second, because of the inherent limits in numeric precision, you'll lose the values in the rightmost digits (they'll appear to be there but when you access the spinner's Value, you'll end up with something like a number in scientific notation). |
Figure 1: Date Spinner—One spinner controls another.
The LostFocus methods for the month and year spinners each call a custom method of the container, FixDays, to update the day spinner's properties, as follows:
Example |
* FixDays DO CASE CASE INLIST(This.nMonth, 1, 3, 5, 7, 8, 10, 12) This.spnDays.SpinnerHighValue = 31 This.spnDays.KeyboardHighValue = 31 CASE INLIST(This.nMonth, 4, 6, 9, 11) This.spnDays.SpinnerHighValue = 30 This.spnDays.KeyboardHighValue = 30 CASE This.nMonth = 2 IF This.LeapYear(This.nYear) This.spnDays.SpinnerHighValue = 29 This.spnDays.KeyboardHighValue = 29 ELSE This.spnDays.SpinnerHighValue = 28 This.spnDays.KeyboardHighValue = 28 ENDIF ENDCASE IF This.nDay > This.spnDays.SpinnerHighValue This.nDay = This.spnDays.SpinnerHighValue ENDIF |
See Also |