A newer version of this page is available. Switch to the current version.

StateIndicator.States Property

Contains states for the state indicator.

Namespace: DevExpress.XtraGauges.Core.Model

Assembly: DevExpress.XtraGauges.v19.1.Core.dll


[XtraSerializableProperty(XtraSerializationVisibility.Collection, true)]
public virtual IndicatorStateCollection States { get; }

Property Value

Type Description

An IndicatorStateCollection that contains states for the state indicator.


Use this property to create, modify and delete states for the state indicator. Each state identifies a specific image.

When a state indicitor is used within a StateIndicatorGauge, to select a specific state, use the StateIndicator.StateIndex property.

In linear and circular gauges, a state is automatically selected depending upon a scale’s current value (ArcScale.Value or LinearScale.Value). For state indicators being used in circular and linear gauges, you need to specify the range of values that correspond to specific states. If the value of the gauge’s scale falls into a specific range, a corresponding state is automatically activated.


Images for state indicators are enumerated by the StateIndicatorShapeType type.

To add images to a state indicator, you need to add items to the StateIndicator.States collection. Each item’s ShapeType property is of the StateIndicatorShapeType type, and it refers to a specific image.

The following code shows how to add three states to a state indicator:

using DevExpress.XtraGauges.Core.Model;
// ...

IndicatorState state1 = new IndicatorState(StateIndicatorShapeType.FlagUSA);
IndicatorState state2 = new IndicatorState(StateIndicatorShapeType.FlagUK);
IndicatorState state3 = new IndicatorState(StateIndicatorShapeType.FlagAustralia);
stateIndicatorComponent1.States.AddRange(new IndicatorState[] {state1, state2, state3});

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the States property.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also