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

Thread: Spin Control

  1. #1
    Join Date
    May 1999
    Posts
    78

    Spin Control

    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.


  2. #2
    Join Date
    May 1999
    Posts
    53

    Re: Spin Control

    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.


  3. #3
    Join Date
    May 1999
    Posts
    78

    Re: Spin Control

    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.



  4. #4
    Join Date
    Apr 1999
    Location
    Frankfurt, Germany
    Posts
    113

    Re: Spin Control

    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


  5. #5
    Join Date
    May 1999
    Posts
    116

    Re: Spin Control

    void CSpinButtonCtrl::SetRange( int nLower, int nUpper );



  6. #6
    Join Date
    May 1999
    Posts
    78

    Re: Spin Control

    Good Stuff...Thanks


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