Skip to main content Skip to footer

C1Knob with Frequency/Interval Step

Recently a customer enquired about an implementation in C1Knob control, part of Gauges for WPF wherein he wanted to change the value with a particular frequency/ interval just like a simple slider control behaves with interval property. By default C1Knob let the user select any numerical value by rotating a pointer clockwise or anti- clockwise. Here in this blog, we will discuss how to change the C1Knob value with a particular frequency or interval with simple code customizations in C1Knob's ValueChanged and MouseLeftButtonUp events. Following code block shows the implementation:-


 private void c1Knob1_ValueChanged(object sender, C1.WPF.PropertyChangedEventArgs<double> e)  
 {  
 if (e.NewValue < e.OldValue)  
 {  
 // Decrementing frequency or interval change by 10  
 KnobValue = e.NewValue = knobOldValue - 10;  
 }  
 else  
 {  
 e.OldValue = knobOldValue;  
 // Incrementing frequency or interval change by 10  
 KnobValue = e.NewValue = e.OldValue + 10;  
 }  
 }  
 void c1Knob1_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)  
 {  
 knobOldValue = c1Knob1.Value = KnobValue;  
 }  

C1Knob with Frequency/Interval Step C1Knob with Frequency/Interval Step Refer to the attached sample for complete implementation. DownloadSample_CS DownloadSample_VB

MESCIUS inc.

comments powered by Disqus