ComponentOne Gauges for WPF and Silverlight
Gauges for WPF and Silverlight Task-Based Help / Setting the Start Value
In This Topic
    Setting the Start Value
    In This Topic

    In this topic you'll change the C1LinearGauge control's C1Gauge.Value property. The Value property determines the currently selected number. By default the C1LinearGauge control starts with its Value set to 0 but you can customize this number at design time, in XAML, and in code. Note that although this topic sets the Value of the C1LinearGauge control, the same steps can be used to customize the Value of other controls.

    At Design Time

    To set the C1LinearGauge control's Value property 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 "20", in the text box next to the Value property.

    This will set the Value property to the number you chose.

    In XAML

    For example, to set the Value property add Value="20" 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" Value="20">
    

    In Code

    For example, to set the Value property, add the following code to your project:

    Visual Basic
    Copy Code
    C1LinearGauge1.Value = 20
    

     

    C#
    Copy Code
    c1LinearGauge1.Value = 20;
    

     

    Run your project and observe:

    Initially the gauge's C1Gauge.Pointer will be set to the Value you selected: