I have a radial gauge that I want to use as a knob with a range of 0 - 120 as the value but the the 0 starts at 135 deg and ends at 405 on the extent. How do I make the knob stop spinning a full 360 deg. When you drag the knob around and it passes 0 or 120 it says the value is a negative number. I really would like them not to be able to drag the knob around a full 360 deg.
While this worked to prevent the dial from going into the negative range the knob then did not perform as expected. If you had the gauge at 120 and then crossed over the negative area with the mouse and touched the zero side of the gauge the knob immediately jumped to a zero value. Since this knob is controlling a machine feed rate I had to check and compare against the previous marker value, and, if the new marker value was over some allowed max ticks away do not move. 120 - 0 instantly would mess the machine up. No big deal but it would seem like something that could be included somewhere for that scenario. Sort of like a sweep range for the knob.
Hello djarnold74,
To prevent the needle from being dragged to an area that's not within the scale, you need to handle the MarkerValueChanged event and test the marker's value to see if it's less than 0. If it is, then either set it to 0 or to 120 in your case.