I have an UltraNumericEditor set to NumericType double, minimum bound 0, maximum bound 1 and MaskInput and FormatString of n.nn and 0.00 respectively.
I use the spin button to spin the hundred's place to 5. I then move to the one's place and spin that digit to 1. I end up with 1.05. This is above the maximum bound. Admittedly, it "sort of" keeps the focus on that control when I leave it. However, I'm not sure if the end-user will pick up on this. Also, I say "sort of" because you can jump to another UltraNumericEditor and start using the spin buttons. You can't edit directly.
What's the recommended way for handling min/max limits? Do you recommend error providers?
Ideally, I would not like the user to be able to enter a number greater than 1 to begin with. If there's no way to prevent some cases (such as pasting in 1.99), I'd at least like to have a more direct notification than just keeping the focus ("sort of") on the control.
Do you have some advice, articles, or example?
Thanks,
Andrew
bibsoconner said:I would not like the user to be able to enter a number greater than 1 to begin with
I'm not following why setting the MaxValue property to 1.0 is not sufficient for this.
bibsoconner said:I'd at least like to have a more direct notification than just keeping the focus
You could handle the ValidationError event and show a MessageBox. Incidentally, the fact that you can "jump to another UltraNumericEditor and start using the spin buttons" sounds like it might be a bug.
Brian,
Thank you for the rapid response; I do appreciate it. I have attached a very simple demo project showing the behavior. Perhaps I have some of the settings wrong? If you play with the first numeric spin button, you will be able to set the number to 1.05, by first spinning the hundreds place to 5, and then the 1's place to 1(the digit to the left of the decimal point. Feel free to correct my terminology :)).
You will then be able to go to the second numeric up/down (using the mouse for example), and use the spin buttons to alter that one. I don't believe you will be able to type directly in the second box.
Since you've had these controls for a long time and they seem to be working great in general (I'm new to them but impressed), I'm guessing that I simply don't have the properties set correctly.
I'll play with the ValidationError.