The WinDateTimeEditor, WinCurrencyEditor, WinMaskedEdit, and WinNumericEditor each has the ability to increment the current value when the user gives a certain input. There are three ways this behavior can be triggered:
The user presses the up/down arrow key.
The user clicks a spin button.
The UpKeyAction
or DownKeyAction
are performed on the control using
PerformAction().
When spin behavior is triggered, the section which the cursor is currently in will be incremented up or down corresponding to the arrow used to trigger it. For the WinDateTimeEditor
, these sections can be month, day, year, while for WinCurrencyEditor
and WinNumericEditor
these can be the integer and decimal sections.
If the SpinIncrement is set, the cursor position will be ignored and the value will be incremented/decremented according to the SpinIncrement
setting.
When a section reaches its maximum value while incrementing, or minimum value while decrementing, the behavior for what happens on the next increment/decrement is defined by the SpinWrapBehavior property. This can be set to:
Default
— By default, the control will follow the WrapAcrossSections
behavior.
NoWrapping
— The value will stop incrementing/decrementing at the max/min.
WrapAcrossSections
— The value will go to the min/max and increment/decrement the next high section.
For example, if a month set at 12 is incremented, the month will go to 1 and the year will be incremented by 1.
WrapCurrentSection
— The value will go to the min/max and no other sections will be affected.
For example, if a month set at 12 is incremented, the month will go to 1 and the year will remain the same.