Ranges are visual elements displayed on your gauge that begins and ends at specified values on a scale. Adding a range to the scale of your gauge lets you highlight specific sections.
You can add range to your scale at design time and runtime.
When you save and run your application after completing the ollowing steps, your gauge should look similar to the gauge below.
To add ranges to your scales using the Gauge Designer:
In the Gauge Explorer, expand Ranges.
Click Add Ranges and select New Range.
In the Value pane of the Range Layout tab of the Properties panel, set the following properties:
Start Value — 66
End Value — 100
In the Extent pane of the Range Layout tab, set the following properties:
Inner Start — 75
Inner End — 85
Outer — 90
Click the Appearance tab. In the Brush pane, set the following properties:
Type — Solid
Color — White
To add ranges to your scales at design time:
In the Gauges collection editor, click the Scales property. Then, click the ellipsis button (…) to open the Scales collection editor.
Click the Ranges property, then click the ellipsis button (…) to open the Ranges collection editor
Click Add.
Click the BrushElement property, and from the drop-down list, select Solid Fill.
Expand the BrushElement property and set the Color property to White.
Set the following properties:
StartValue — 66
EndValue — 100
InnerExtentStart — 75
InnerExtentEnd — 85
OuterExtent — 90
To add ranges to your scales at run time:
Add the following steps to the load event.
Create instances of the classes:
In Visual Basic:
Dim myRange As New RadialGaugeRange Dim mySolidFillBrushElement3 As New SolidFillBrushElement()
In C#:
RadialGaugeRange myRange = new RadialGaugeRange(); SolidFillBrushElement mySolidFillBrushElement3 = new SolidFillBrushElement();
Set the following color properties:
Type — Solid
Color — White
In Visual Basic:
mySolidFillBrushElement3.Color = System.Drawing.Color.White myRange.BrushElement = mySolidFillBrushElement3
In C#:
mySolidFillBrushElement3.Color = System.Drawing.Color.White; myRange.BrushElement = mySolidFillBrushElement3;
Set the following properties:
EndValue — 100
InnerExtentEnd — 75
InnerExtentStart — 85
OuterExtent — 90
StartValue — 66
In Visual Basic:
myRange.EndValue = 100 myRange.InnerExtentEnd = 75 myRange.InnerExtentStart = 85 myRange.OuterExtent = 90 myRange.StartValue = 66
In C#:
myRange.EndValue = 100; myRange.InnerExtentEnd = 75; myRange.InnerExtentStart = 85; myRange.OuterExtent = 90; myRange.StartValue = 66;
Add your range to the Ranges collection:
In Visual Basic:
myScale.Ranges.Add(myRange)
In C#:
myScale.Ranges.Add(myRange);