Spin Control

Posted on 2004-11-13
Last Modified: 2013-11-20
I use Spin control with buddy
For the Dialog based application I drad and drop the Spin control and Edit Control
When the application runs the down pointed  arrow INCREASED the number (0,1,2 ,3)
and UP pointed - DECREASED.(3,2,1,0)
I would like the normal behavior
down pointed  arrow - decrease
up pointed - increase

How can I do it?
Question by:YanushA
    LVL 48

    Expert Comment

    Use SetRange function to set lower and upper range of the control:

    m_spin.SetRange(1, 100);

    From MSDN topic CSpinButtonCtrl::SetRange:

    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.

    Author Comment

    Thank you very much.It works.

    Does it means that I can't work with Spin control "as is"
    (just drag and drop) without this minimal programming?
    LVL 48

    Accepted Solution

    Yes, if you don't like it's default behaviour. In any case, setting control range looks like obligatory action.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
    Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now