CSpinButtonCtrl Disable/Enable

Posted on 2001-06-12
Last Modified: 2013-11-20
Can you disable, the UP/DOWN button, in a CSpinbuttonCtrl.. I don't wanna disable both up/down..

How is it done ?
Question by:win32
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 6182273
Did you tried EnableWindow(FALSE)?

Author Comment

ID: 6182292
Now see thats the problem MichaelS if i do it like that I will enable/disable all of the button..
LVL 42

Expert Comment

ID: 6182387
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)
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 42

Accepted Solution

sedgwick earned 100 total points
ID: 6182393
or go to the link below and download it, whatever u like:

Author Comment

ID: 6182970
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 ?

Expert Comment

ID: 6183456
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.
LVL 42

Expert Comment

ID: 6184931
win32: no other way dude, and let me disagree, i think this smart spin control is totaly cool and no hard work too.

Expert Comment

ID: 6184973
Try to set range of spin control to Min, Max.
Then Set position to Min or Max to disable Up or DOWN arrow.

Author Comment

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

Author Comment

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

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
repeateFront java challenge 31 95
Perl Awk Need Help 3 139
ORA-01403: no data found 43 112
Change owner from userA to server Local Administrators 7 71
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 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