2.2.6.29.6 SpinButton::SetRange

Description

Syntax

void SetRange( int nLower, int nUpper )

Parameters

nLower
New lower limit for the control.
nUpper
New upper limit for the control.

Return

Examples

EX1

#include <Control.h>
#include <..\OriginLab\DialogEx.h>
#define IDC_SPIN1 1001

void SpinButton_SetRange(Dialog& MyDlg)
{
	SpinButton  m_spBtn = MyDlg.GetItem(IDC_SPIN1);
	m_spBtn.SetRange(2, 14);
}

Remark

Call this function to set the upper and lower limits (range) for a spin button control.

The default range for the spin button has the maximum set to zero (0) and the minimum set to 100.

Since 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.

See Also

Header to Include

Control.h