Link to home
Start Free TrialLog in
Avatar of win32
win32

asked on

CSpinButtonCtrl Disable/Enable

Can you disable, the UP/DOWN button, in a CSpinbuttonCtrl.. I don't wanna disable both up/down..

How is it done ?
Avatar of MichaelS
MichaelS

Did you tried EnableWindow(FALSE)?
Avatar of win32

ASKER

Now see thats the problem MichaelS if i do it like that I will enable/disable all of the button..
Avatar of Meir Rivkin
if u wanna disable one of them u need to post your e-mail address and i'll send u a sample program since its pretty long (but not difficult though)
ASKER CERTIFIED SOLUTION
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of win32

ASKER

I can see that.. Hmm but it's not realy cool, youd would have to overload that standard MFC class, because it is not included..

There is no other way ?
The other way is to process the click :-) ... Jokes apart ... What you cd do is leave it enabled .. and OnClick of that spin button you wd anyway get the message and when u get the message as say an UPSPIN, and your program knows that it should not UPSPIN - just give a BEEP and don't process further.
In essence, just add the BEEP in you OnClick function when u don't need it.
win32: no other way dude, and let me disagree, i think this smart spin control is totaly cool and no hard work too.
Try to set range of spin control to Min, Max.
Then Set position to Min or Max to disable Up or DOWN arrow.
Avatar of win32

ASKER

Sure sedqwick it's cool, just a bit of code to get the job done, but thanks for the help :-)
Avatar of win32

ASKER

Sure sedqwick it's cool, just a bit of code to get the job done, but thanks for the help :-)