|
-
February 9th, 2006, 12:34 AM
#7
Re: How to check if Up/Down Button is pressed on NumericUpDown Control...
Are you doing this so that the user cannot enter values like 21, 23, etc. or are you just trying to make the NUD increment faster at higher values? If it's the former then you're out of luck as the user can type any number they want directly into the NUD anyway. If you absolutely want to restrict the value then you'd need to use a DomainUpDown instead and use a loop to populate it in the first place. If it's the latter you can manipulate the Increment property so that pressing a button changes the value by whatever amount you want. You could set the Increment to 1 below 20, change it to 2 above 20 and then to 3 above 60 or whatever. The problem comes at the boundaries. When the Value is 20 do you make the Increment 1 or 2, because you don't whether the next change will be up or down? It probably doesn't matter because the user can just hold down a button and the value will change faster and faster anyway. I could be wrong but it seems like you're trying to solve a problem that doesn't exist, or else you're trying to solve the wrong problem.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|