Click to See Complete Forum and Search --> : CSpinButtonCtrl increasing buddy when wanting the other way arround


May 26th, 1999, 09:43 AM
Created a dialog with a CSpinButtonCtrl with auto buddy !
When I click on the down arrow it increases the value in the buddy and
when I click on the up arrow it decreases the value in the buddy,
I do not seem to find how i can inverse this behavior

Red Dorakeen
May 26th, 1999, 10:37 AM
Very easy to fix. In the OnInitDialog function of your dialog box containing the spin control, add the following code:

m_spin.SetRange(int a, int b);

where m_spin is the member variable for your spin control, a is the lower value of your range, and b the upper. After this, your spin control will only go in the range from a to b, but WILL work in the proper direction.

-Red