ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

gauge scaleRangeFills programatically

Hello friends
 
please Help me
How change programmatically RangeFills in Gauge ?
 
range gauge I can change :

Me

.Gauge1.Range = New NationalInstruments.UI.Range(500, 1800)

but rangeFills I can't...

 
thanks
Boguslaw
0 Kudos
Message 1 of 3
(3,778 Views)
Hi Boguslaw,
 
You can do the following:

' Create the new range fill object

Dim newRange = New Range(0.0, 5.0)
Dim newRangeFillStyle As ScaleRangeFillStyle

newRangeFillStyle = ScaleRangeFillStyle.CreateStyleFromFillStyle(FillStyle.Wave, Color.Blue)
Dim newRangeFill = New ScaleRangeFill(newRange, newRangeFillStyle)

' Check for existing range fill objects in collection. If one doesn't exist, one the new range fill object to collection
If (Gauge1.RangeFills.Count <> 0)
Then
     Gauge1.RangeFills(0) = newRangeFill
Else
     Gauge1.RangeFills.Add(newRangeFill)
End If

Best Regards,



Message Edited by Jonathan N on 03-29-2008 10:59 AM
Jonathan N.
National Instruments
0 Kudos
Message 2 of 3
(3,755 Views)

Hi

it work very good !:)

 

thanks

Boguslaw



Message Edited by mototest on 03-31-2008 01:33 AM
0 Kudos
Message 3 of 3
(3,739 Views)