Share via


CSpinButtonCtrl::Create

BOOLCreate(DWORDdwStyle**,constRECT&rect,CWnd*pParentWnd,UINTnID);**

Return Value

Nonzero if initialization was successful; otherwise 0.

Parameters

dwStyle

Specifies the spin button control’s style. Apply any combination of spin button control styles to the control.

rect

Specifies the spin button control’s size and position. It can be either a CRect object or a structure

pParentWnd

A pointer to the spin button control’s parent window, usually a CDialog. It must not be NULL.

nID

Specifies the spin button control’s ID.

Remarks

You construct a CSpinButtonCtrl object in two steps. First call the constructor, then call Create, which creates the spin button control and attaches it to the CSpinButtonCtrl object.

The following styles are specific to spin button controls:

  • UDS_HORZ   Causes the control’s arrows to point left and right instead of up and down.

  • UDS_WRAP   Causes the position to “wrap” if it is incremented or decremented beyond the ending or beginning of the range.

  • UDS_ARROWKEYS   Causes the control to increment and decrement the position when the UP ARROW and DOWN ARROW keys are pressed.

  • UDS_SETBUDDYINT   Causes the control to set the text of the buddy window (using the WM_SETTEXT message) when the position changes. The text consists of the position formatted as a decimal or hexadecimal string.

  • UDS_NOTHOUSANDS   Does not insert a thousands separator between every three decimal digits.

  • UDS_AUTOBUDDY   Automatically selects the previous window in the Z-order as the control’s buddy window.

  • UDS_ALIGNRIGHT   Positions the spin button control next to the right edge of the buddy window. The width of the buddy window is decreased to accommodate the width of the control.

  • UDS_ALIGNLEFT   Positions the spin button control next to the left edge of the buddy window. The buddy window is moved to the right and its width decreased to accommodate the width of the control.

CSpinButtonCtrl OverviewClass MembersHierarchy Chart

See Also   CSpinButtonCtrl::CSpinButtonCtrl