i need help whit the numericUpDown
I tried many ways but first let me explain the objective of the
control
1 - range from 1 to 100
2 -the person can enter higher value that 100 but it put back to 100
and popup the person
3- when pressing up it goes to closest increment of 25 (25-50-75-100
are possible value)
4- when pressing down it goes to closest increment of 25 (75-50-25-1)
the first thing is that 1 next increment of 25 isnt 25 but 26
ok so i set on the value change is the value happen to be 26 set value
to 25.
by default problem 2 is solved by itself nearly because numeric value
under minimum set back to minimum and value over maximum set to
maximum. the popup i was able with the Keypress check the numeric.text
and test if it was higher than the maximum and i made the popup it
work fine
the problem is. when i manually change value it trigger the
valuechange and the click up or down also trigger it.
if anyone know how i can capture in the valuechange has been triggered
by the up and down button or not i would be able to test all this.
if i put in the value change :
if(numeric.value >0 && numeric.value <25)
{
numeric.value = 25;
}
it work to go up to closest 25 increment but if i type 19 for example
and want 19 it doesnt distinguish if i clicked up to go to 25 or if i
change the value to 19 for him both trigger the code but it work only
for 1.