Click to See Complete Forum and Search --> : Spin Control


Saeed R
May 10th, 1999, 06:38 PM
An Spin control next to an Edit control increases by down arrow and decreases by up arrow...Strange as it seems ,how do you swap this functionality.

shellreef
May 10th, 1999, 06:42 PM
The reason for this is the maximum value is 0 and minimum value is 100.hrm..
Try setting maximum to 100 and minimum to 0, or whatever numbers you want to use. This should work.

Saeed R
May 10th, 1999, 07:09 PM
Max 100 and Min 0 is set by the control itself and i have not set them....
and there is no ref to Min and Max on the aproperties on the CTRL.

Rudolf
May 11th, 1999, 02:24 AM
Hi,
with Your Spin Control You have a message handler:
OnDeltapos(NMHDR* pNMHDR, LRESULT* pResult)
Class wizard defines a variable in it:
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
The numbers are changed with the value
pNMUpDown->iDelta
To swap it You only have to multiplicate it with -1.
BTW: the direction of the spin button is exactly the same as it is with scrollbars. So, lots of people (including me) would expect the standard behavior...

HTH
Rudolf

BrianOG
May 11th, 1999, 05:29 AM
void CSpinButtonCtrl::SetRange( int nLower, int nUpper );

Saeed R
May 12th, 1999, 10:31 PM
Good Stuff...Thanks