Condividi tramite


CSpinButtonCtrl::SetRange

Sets the upper and lower limits (range) for a spin button control.

void SetRange( 
   short nLower, 
   short nUpper  
); 
void SetRange32( 
   int nLower, 
   int nUpper  
);

Parameters

  • nLowerand nUpper
    Upper and lower limits for the control. For SetRange, neither limit can be greater than UD_MAXVAL or less than UD_MINVAL; in addition, the difference between the two limits cannot exceed UD_MAXVAL. SetRange32 places no restrictions on the limits; use any integers.

Remarks

The member function SetRange32 sets the 32-bit range for the spin button control.

Note

The default range for the spin button has the maximum set to zero (0) and the minimum set to 100. Because the maximum value is less than the minimum value, clicking the up arrow will decrease the position and clicking the down arrow will increase it. Use CSpinButtonCtrl::SetRange to adjust these values.

Requirements

Header: afxcmn.h

See Also

Reference

CSpinButtonCtrl Class

Hierarchy Chart

CSpinButtonCtrl::GetRange

CSpinButtonCtrl::GetPos

Using CSpinButtonCtrl