Version

Apply the Solid Brush Element at Run Time

If you want a property of your gauge to be one solid color, apply the Solid brush element to the property.

To apply the Solid brush element to a property of your gauge using code:

  1. Before you start writing any code, you should place using/Imports directives in your code-behind so you don’t need to always type out a member’s fully qualified name.

In Visual Basic:

Imports Infragistics.UltraGauge.Resources

In C#:

using Infragistics.UltraGauge.Resources;
  1. Create the load event.

  2. Create the class instances.

In Visual Basic:

Dim myRadialGauge As RadialGauge = Me.UltraGauge1.Gauges(0)
Dim solidFillBrushElement1 As New SolidFillBrushElement()

In C#:

RadialGauge myRadialGauge = this.ultraGauge1.Gauges[0] as  RadialGauge;
SolidFillBrushElement solidFillBrushElement1 = new SolidFillBrushElement();
  1. Set the color to Black.

In Visual Basic:

solidFillBrushElement1.Color = System.Drawing.Color.Black
myRadialGauge.Dial.BrushElement = solidFillBrushElement1

In C#:

solidFillBrushElement1.Color = System.Drawing.Color.Black;
myRadialGauge.Dial.BrushElement = solidFillBrushElement1;