I would expect the guague control to automatically support certain behavior. Like clicking and draging a marker (needle) in a Linear Gauge.
How do I get this behavior? Do I have to code up all the mouse event handlers, etc..?
Thanks David!
That example was exaclty what I needed. Thank You!
please run this form for a demonstration.
using Infragistics.UltraGauge.Resources;
using Infragistics.Win.UltraWinGauge;
using System;
using System.Windows.Forms;
public class Form1 : Form
{
private UltraGauge ultraGauge1;
this.ultraGauge1.Dock = DockStyle.Fill;
LinearGauge lin = new LinearGauge();
linearScale.StartExtent = 10.0;
linearScale.EndExtent = 90.0;
linearScale.MajorTickmarks.StrokeElement.Color = Color.Black;
axis.StartValue = 0.0;
axis.EndValue = 10.0;
axis.TickmarkInterval = 1.0;
needle.Value = 3.14;
lin.Scales.Add(linearScale);
linearScale.Axis = axis;
linearScale.Markers.Add(needle);
this.ultraGauge1.MouseMove += new MouseEventHandler(this.ultraGauge1_MouseMove);
this.ultraGauge1.MouseUp += new MouseEventHandler(this.ultraGauge1_MouseUp);
}
private LinearGaugeNeedle DraggingNeedle { get; set; }
this.DraggingNeedle.Value =
this.DraggingNeedle = null;
Which events need handling to get this behavior? I have gone through the events, and cannot figure it out.
sorry you couldn't get a response in time. in the future, if you are using an infragistics product and need a prompt response, please use an official support channel (i.e. Developer Support). they have a guaranteed response and very quick turnaround, unlike these peer-to-peer forums.
http://ko.infragistics.com/gethelp
as for needle dragging on linear gauges, this is not yet available as a feature of linear gauges -- radial gauge needles do have an AllowDrag property, but the feature is still not implemented for linear gauges. you can still achieve this behavior through event handling, though.