Udostępnij za pośrednictwem


Spin Button Member Functions

There are several member functions available for the spin control (CSpinButtonCtrl). Use these functions to change the following attributes of the spin button.

  • Acceleration   You can adjust the rate at which the position changes when the user holds down the arrow button. To work with acceleration, use the SetAccel and GetAccel member functions.

  • Base   You can change the base (either 10 or 16) used to display the position in the caption of the buddy window. To work with the base, use the GetBase and SetBase member functions.

  • Buddy Window   You can dynamically set the buddy window. To query or change which control is the buddy window, use the GetBuddy and SetBuddy member functions.

  • Position   You can query and change the position. To work directly with position, use the GetPos and SetPos member functions. Since the caption of the buddy control may have changed (for example, in the case that the buddy is an edit control), GetPos retrieves the current caption and adjusts the position accordingly.

  • Range   You can change the maximum and minimum positions for the spin button. By default, the maximum is set to 0, and the minimum is set to 100. Since the default maximum is less than the default minimum, the actions of the arrow buttons is counter-intuitive. Typically, you will set the range using the SetRange member function. To query the range use GetRange.

See Also

Concepts

Controls (MFC)

Reference

Using CSpinButtonCtrl