ComponentOne Gauges for WPF and Silverlight
Gauges for WPF and Silverlight Task-Based Help / Setting the Minimum and Maximum Values
In This Topic
    Setting the Minimum and Maximum Values
    In This Topic

    You can use the C1Gauge.Minimum and C1Gauge.Maximum properties to set a numeric range that the gauge would be limited to. You can customize the Minimum and Maximum values at design time, in XAML, and in code. Although this topic sets the Minimum and Maximum properties of the C1LinearGauge control, the same steps can be used to customize the Minimum and Maximum of other controls.

    NOTE: When setting the Minimum and Maximum properties, the Minimum should be smaller than the Maximum. Also be sure to set the C1Gauge.Value property to a number within the Minimum and Maximum range (here the default is 0, which falls within the range set below).
       

    At Design Time

    To set the Minimum and Maximum for the C1LinearGauge at run time, complete the following steps:

    1. Click the C1LinearGauge control once to select it.
    2. Navigate to the Properties window, and enter a number, for example 50, next to the Maximum property.
    3. In the Properties window, enter a number, for example -50, next to the Minimum property.

    This will set Minimum and Maximum values.

    In XAML

    To set the C1LinearGauge control's Minimum and Maximum in XAML addMaximum="50" Minimum="-50" to the <c1:C1LinearGauge> tag so that it appears similar to the following:

    <c1:C1LinearGauge Height="89" Margin="47,57,33,43" Name="C1LinearGauge1" Width="287" Maximum="50" Minimum="-50">
    

    In Code

    To set the C1LinearGauge control's Minimum and Maximum add the following code to your project:

    Visual Basic
    Copy Code
    C1LinearGauge1.Minimum = -50
    C1LinearGauge1.Maximum = 50
    

     

    C#
    Copy Code
    c1LinearGauge1.Minimum = -50;
    c1LinearGauge1.Maximum = 50;
    

    Run your project and observe:

    The gauge will be limited to the selected range at run time: