From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

NumericEdit: How do I suppress the acceleation of the spin button value changing?

I use the NumericEdit control to live-change values during the spin buttons being pressed.

This works great but has a big risk: The acceleration setting in after a moment causes the values to increment too fast which could become dangerous.

As these are controller parameters, amplitudes etc., it could destroy the hardware system if wrong values are applied by accident.

 

So is there a way to disable this acceleration or (if not) limit it to a maximum delta?

 

Thanks in advance,

Daniel

0 Kudos
Message 1 of 4
(5,003 Views)

Hi Daniel,

 

sorry, but I don't completely follow, what you are doing, could you attach a short example project, so I can reproduce and see the error?

 

 



Remember Cunningham's Law
0 Kudos
Message 2 of 4
(4,984 Views)

Hi Peter,

 

I attached a simple C# project containing only a form with a NumericEdit control.

If you click and hold the spin-up button the control counts up slowly and after ~1s starts to accelerate and counts up with much higher speed.

I would like to know if there is a way to make it not accelerate at all (constant speed from the beginning) or only to a lower speed than it does now.

 

There is no error in the sense of something going wrong. Just the behaviour is not as I would like it.

 

Greetings from Darmstadt!

Daniel

 

0 Kudos
Message 3 of 4
(4,982 Views)

That's simple enough, thank you.

 

I attached a Project that shows how to slow this down.you just add some sleep time to the event call.

 

I am aware tat this is not the best solution, because in the beginning it adds the sleep time to the time that the function would wait normally. So if you like, you can go looking in the lower layers for the part where the actuall wait time or acceleration is implemented. Feel free to change those functions.

 

Best regards



Remember Cunningham's Law
0 Kudos
Message 4 of 4
(4,970 Views)