• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1139
  • Last Modified:

Spin Control

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?
0
YanushA
Asked:
YanushA
  • 2
1 Solution
 
AlexFMCommented:
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.
0
 
YanushAAuthor Commented:
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?
0
 
AlexFMCommented:
Yes, if you don't like it's default behaviour. In any case, setting control range looks like obligatory action.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now