Skip to main content

TdxGaugeRangeCollection.Items Property

Provides zero-based indexed access to ranges within a scale.

Declaration

property Items[Index: Integer]: TdxGaugeCustomRange read; write; default;

Property Value

Type
TdxGaugeCustomRange

Remarks

Use this property to access individual ranges by their indexes passed as the Index parameter. The Items property provides access to settings common for all types of ranges. In order to access the range type-specific settings, you need to cast the returned TdxGaugeCustomRange object to the range type you are currently working with. Refer to the following code example:

var
  ARange: TdxGaugeCircularScaleRange;  // Use this variable to address the range's properties properly
  AMaxIndex: Integer;
//...
  AMaxIndex := 0;
// Creating a single range within the circular scale...
  dxGaugeControl1CircularScale1.Ranges.Add;
  if(dxGaugeControl1CircularScale1.Ranges.Count > 0) then
    AMaxIndex := dxGaugeControl1CircularScale1.Ranges.Count - 1;
// Make sure that the collection item stores the required range type...
  if(dxGaugeControl1CircularScale1.Ranges[AMaxIndex].ClassName = 'TdxGaugeCircularScaleRange') then
// Accessing the last circular range within the collection...
    ARange := TdxGaugeCircularScaleRange(dxGaugeControl1CircularScale1.Ranges[AMaxIndex]);

Note

In order to access a particular range, it should actually exist within the collection. For additional information on working with range objects in quantitative scales, refer to the How to Work with Scale Range Bars topic.

See Also