Spin Control
A sin control, also called up-down control, is a pair of arrow buttons that
the user can click to increment or decrement a value, such as a scroll position
or a number displayed in a companion control. The value associated with an
up-down control is called its current position. An up-down control is most often
used with a companion control, which is called a buddy window
Styles
- Select buddy automatically.If this style is specified, the up-down
control automatically selects the previous window in the z-order as its
buddy window. This window might be the previous control in a dialog box
template. You can use UDM_SETBUDDY to assign a specific buddy window
to an up-down control. To determine an up-down control's current buddy
window, use the
UDM_GETBUDDY
message. An up-down control and its buddy window must have the same parent
window.
- No thousands. An up-down control with this
style sets the caption of its buddy window whenever the current position
changes. The control inserts a thousands separator between every three
digits of a decimal string unless the
UDS_NOTHOUSANDS
style is specified. If the buddy window is a list box, an up-down control
sets its current selection instead of its caption.
- Set buddy integer. An up-down control with this
style sets the caption of its buddy window whenever the current position
changes.
- Wrap beyond selected range. By default, the current position does
not change if the user attempts to increment it or decrement it beyond the
maximum or minimum value. You can change this behavior by using the
UDS_WRAP
style, so the position "wraps" to the opposite extreme. For
example, incrementing past the upper limit wraps the position back to the
lower limit.
- Use arrow keys. You can specify this
style to provide a keyboard interface for an up-down control. If this style
is specified, the control processes the and keys. The control also
subclasses the buddy window so that it can process these keys when the buddy
window has the focus.
- Alignment. An up-down control with the
UDS_ALIGNLEFT
or
UDS_ALIGNRIGHT
style aligns with the left or right edge of its buddy window. The width of
the buddy window is decreased to accommodate the width of the up-down
control.