CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    CSpinButtonCtrl increasing buddy when wanting the other way arround

    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


  2. #2
    Join Date
    May 1999
    Posts
    25

    Re: CSpinButtonCtrl increasing buddy when wanting the other way arround

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured