09-26-2005 12:11 PM
09-26-2005 01:45 PM
Hi,
I'm not sure if 7.1 is the same as 7.0, but you
1. Right click the control and go to properties
2. There should be a tabe called "pointers". under the listbox there is a add button. press the add button.
3. When you do the Value, do ControlName.pointer.item(index of pointer).value
Hope this helps...
B
09-26-2005 04:49 PM
Hello Bum,
Well, I've hunted for "pointers" in the properties page for both the meter and gauge. I can't find it.
Thanks for the help,
Dennis
09-26-2005 05:04 PM
public class MultiplePointerGauge : Gauge { private double _maxPointerValue; private Color _maxPointerColor; public MultiplePointerGauge() : base() { GaugeStyle = new MultiplePointersStyle(); _maxPointerColor = PointerColor; _maxPointerValue = Value; } public Color MaxPointerColor { get { return _maxPointerColor; } set { _maxPointerColor = value; Invalidate(); } } public double MaxPointerValue { get { return _maxPointerValue; } set { _maxPointerValue = value; Invalidate(); } } private class MultiplePointersStyle : GaugeStyle { private GaugeStyle _baseStyle; public MultiplePointersStyle() : this(GaugeStyle.SunkenWithThickNeedle3D) { } public MultiplePointersStyle(GaugeStyle baseStyle) { if(baseStyle == null) throw new ArgumentNullException("baseStyle"); _baseStyle = baseStyle; } public override void DrawSpindle(IGauge context, RadialNumericPointerStyleDrawArgs args) { _baseStyle.DrawSpindle(context, args); } public override float GetDialRadius(IRadialNumericPointer context, Graphics graphics, Rectangle bounds) { return _baseStyle.GetDialRadius(context, graphics, bounds); } public override void DrawDial(IRadialNumericPointer context, RadialNumericPointerStyleDrawArgs args) { _baseStyle.DrawDial(context, args); } public override RadialNumericPointerHitTestInfo HitTest(IRadialNumericPointer context, Rectangle bounds, int x, int y) { return _baseStyle.HitTest(context, bounds, x, y); } public override void DrawPointer(INumericPointer context, NumericPointerStyleDrawArgs args, double value) { MultiplePointerGauge gauge = context as MultiplePointerGauge; Color defaultColor = context.PointerColor; _baseStyle.DrawPointer(context, args, value); context.PointerColor = gauge.MaxPointerColor; _baseStyle.DrawPointer(context, args, gauge.MaxPointerValue); context.PointerColor = defaultColor; } public override float GetScaleRadius(IRadialNumericPointer context, Graphics graphics, Rectangle bounds) { return _baseStyle.GetScaleRadius (context, graphics, bounds); } } }
09-26-2005 07:54 PM
11-09-2009 10:10 AM
Hi,
Converted the class code to VB.NET, see the 2 new properties, but don't see a 2nd pointer.
Can someone please post a sample program in VB.NET or C# please.
Why isn't there a pointers collection like in the ActiveX version of the control?
I need a 2nd pointer for my app...please help 😉
11-09-2009 11:39 AM
U could try to use the control in 6.0, then convert the 6.0 project into vb.net. I don't know why, but in 6.0 you can add multiple pointers. I attached a pic of the ActiveX interface in 6.0 hope it uploaded. Not sure why this functionality isn't readily apparent in later versions...
11-09-2009 12:15 PM
Yes. I know, but I didn't want to use an ActiveX control when there's a NET version.
I think NI designed the NET controls completly new. That's ok for me. But it's not ok
that they lost some of their functionality ;-(
The NET version is out now for about 5 years and they didn't add a collection for pointers,
very disappointing I must say.
12-04-2009 03:41 PM
For that particular need (a max indicator), a workaround is to use the [RangeFills] collection. You can specify a range that is from an 'x' angle to 'x+1' and make its width to something large, such as 10 or 20. That way you will have a specific indicator in your gauge.
Another option is to use a CustomDivisions collection element.
08-24-2010 07:25 AM
hi can you attach a small application which uses your class
thanks..