Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Collapse]Gauge Controls
   [Expand]Getting Started
    Scales
    Value Indicators
   [Expand]Visual Elements
   [Collapse]Examples
    [Collapse]Circular Gauges
      How to: Use ArcScale
      How to: Show Two Circular Scales Side-by-Side
      How to: Determine whether an Indicator's Value Falls into a Particular Range
      How to: Create a Knob-like Gauge
      How to: Place One Circular Scale into Another
    [Expand]Linear Gauges
    [Expand]Digital Gauges
    [Expand]State Indicators
    [Expand]End-User Interaction
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Determine whether an Indicator's Value Falls into a Particular Range

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E3328.

In some cases, you need to know whether or not the current value of an indicator is within a particular range. This example shows how to create a state indicator that changes its color depending on the current range.

First, the Circular gauge is created with three ranges and two empty sections. By default, the gauge's needle doesn't belong to any range, so the state indicator is painted as a gray ellipse.

To solve this task it's necessary to handle the RangeBase.IndicatorEnter and RangeBase.IndicatorLeave events in the following way:

- if a needle 'enters' a range, it is painted with the range color;

- if a needle 'leaves' a range, it is painted in gray.

Note

In this example we set the ValueIndicatorBase.IsInteractive property to True, so that you can click on a gauge and manually change the current needle value.

Is this topic helpful?​​​​​​​