Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How To keep CNiKnob from going directly from the Min axis value to the Max axis value?

When a user drags the pointer on a CNiKnob with the mouse, he/she is able to drag the pointer directly from the minimum axis value to the maximum axis value.
This is obviously unacceptable. So is there a way to disable this behavior or a work around?
0 Kudos
Message 1 of 3
(3,177 Views)
Unfortunately, there is not an easy way to do this with CNiKnob. One way you could work around it would be to handle the CNiKnob's OnPointValueChanged event and keep track of the previous value, then detect if the value jumps from the min to the max or vice versa and if it does, set it back.

If you migrate to .NET in the future, the Measurement Studio Windows Forms .NET Knob control lets you easily configure this and is the default behavior when you add a Knob to your form. For more info, see the documentation for the Knob.InteractionMode property.

- Elton
0 Kudos
Message 2 of 3
(3,177 Views)
Thanks for the answer. I was afraid you would say that. I am working on just the work around you desribe, but it is not so straight forward since with double values one needs to use inequalities, and the exact min and max do not always come up when crossing zero.
0 Kudos
Message 3 of 3
(3,177 Views)