I have a dialog in MFC with a CSpinButtonCtrl
and an attached buddy (CEdit
). They work correctly when the maximum value of the spin control is lower than 1000, but if it is higher, the value in the CEdit
is clamped to the thousand units when the the value is 1000 or higher (it is clamped to 4 instead of 4345, for example).
BEGIN
EDITTEXT IDC_EDIT_1,274,42,40,14,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_SPIN_1,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,313,42,11,14
END
The range is set programmatically:
const int max_value = 5000;
auto spin = (CSpinButtonCtrl*)GetDlgItem(IDC_SPIN_1);
spin->SetRange(1, max_value);
Any idea what's going on?