NumericUpDown in hexadecimal mode bug
-
When I use a NumericUpDown with Hexadecimal=false and a number that is too large or to small is entered, it is set to the corresponding limit. With Hexadecimal=true however, the value is reset to the previous, correct, value, when a value too large or too small is entered. I have tried to intercept the ValueChanged and various other events to get the same effect as with Hexadecimal=false, but there seems to be no situation in which I can read the entered value instead of the already reset value and adjust it manually. Does anybody know a solution to this problem? Thanks
-
When I use a NumericUpDown with Hexadecimal=false and a number that is too large or to small is entered, it is set to the corresponding limit. With Hexadecimal=true however, the value is reset to the previous, correct, value, when a value too large or too small is entered. I have tried to intercept the ValueChanged and various other events to get the same effect as with Hexadecimal=false, but there seems to be no situation in which I can read the entered value instead of the already reset value and adjust it manually. Does anybody know a solution to this problem? Thanks
Try to handle Validating or KeyDown events
Regards:rose:
-
Try to handle Validating or KeyDown events
Regards:rose:
Thanks for the reply! I tried Validating, but that is only thrown, when the NumericUpDown gets the focus or looses it and in similar situations. It doesn't seem to be thrown right before the value is changed wrongly. I also tried KeyDown, but wasn't able to intercept the value the NumericUpDown should take after the Key was pressed if there was no maximum and exchange it for the real value. I solved my problem by enhancing a TextBox to take only hexadecimal numbers, adding a minimum and maximum etc. to it.