viSci Posted November 4, 2009 Report Share Posted November 4, 2009 Lets say you have a numeric control set to the value of 1. If you set the key focus you will see that the text field in the control becomes hightlighted. If you repeatedly press the up arrow on the control you will notice the value incrementing 1,2,3..8,9,10, and then jump to 20,30,40 etc. If you use the up arrow on the keyboard then it will increment by one throughout the range. I am inclined to consider the nonuniform incrementing to be a bug since in my case it is undesirable and even hazardous since it can cause a system control value (gas pressure for example) to unexpectedly jump up in value. The solution I found is to use the NumText.SelStart and End properties to force the whole numeric field to remain selected and then the value will increment uniformly. Quote Link to comment
Aristos Queue Posted November 4, 2009 Report Share Posted November 4, 2009 Lets say you have a numeric control set to the value of 1. If you set the key focus you will see that the text field in the control becomes hightlighted. If you repeatedly press the up arrow on the control you will notice the value incrementing 1,2,3..8,9,10, and then jump to 20,30,40 etc. If you use the up arrow on the keyboard then it will increment by one throughout the range. I am inclined to consider the nonuniform incrementing to be a bug since in my case it is undesirable and even hazardous since it can cause a system control value (gas pressure for example) to unexpectedly jump up in value. The solution I found is to use the NumText.SelStart and End properties to force the whole numeric field to remain selected and then the value will increment uniformly. Curiously enough, there was a debate just last week within R&D about whether this was a bug or not. There was no agreement, and those responsible for the differences are no longer around. You should be aware of the following arrow key behavior: It increments whichever digit the cursor is next to. So if your cursor is next to the tens digit, you'll increment by 10. Next to the hundreds digit, you'll increment by 100. In that respect, it is more flexible than the increment arrows. Desired behavior? I don't know. I found it because I changed the increment setting of the numeric to increment by 2, and yet the up arrow still incremented by one. The arrow keys are unaffected by the increment defined for the numeric. The behavior is what it is, and I doubt it will change because someone might want it. But I think (hope) you can build an XControl that intercepts the up and down arrow keys and applies different behavior. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.