RangeValuePattern.RangeValuePatternInformation.Value RangeValuePattern.RangeValuePatternInformation.Value RangeValuePattern.RangeValuePatternInformation.Value RangeValuePattern.RangeValuePatternInformation.Value Property

定義

UI オートメーションUI Automation 要素の現在の値を取得します。Gets the current value of the UI オートメーションUI Automation element.

public:
 property double Value { double get(); };
public double Value { get; }
member this.Value : double
Public ReadOnly Property Value As Double

プロパティ値

UI オートメーションUI Automation要素の現在の値。要素nullがをサポートValueしていない場合は。The current value of the UI オートメーションUI Automation element or null if the element does not support Value. 既定値は 0.0 です。The default value is 0.0.

次の例では、 RangeValuePatternターゲットコントロールから取得したオブジェクトが、現在RangeValuePatternのプロパティ値を取得する関数に渡されます。In the following example, a RangeValuePattern object obtained from a target control is passed into a function that retrieves the current RangeValuePattern property values.

///--------------------------------------------------------------------
/// <summary>
/// Gets the current property values from target.
/// </summary>
/// <param name="rangeValuePattern">
/// A RangeValuePattern control pattern obtained from 
/// an automation element representing a target control.
/// </param>
/// <param name="automationProperty">
/// The automation property of interest.
/// </param>
///--------------------------------------------------------------------
private object GetRangeValueProperty(
    RangeValuePattern rangeValuePattern,
    AutomationProperty automationProperty)
{
    if (rangeValuePattern == null || automationProperty == null)
    {
        throw new ArgumentException("Argument cannot be null.");
    }

    if (automationProperty.Id ==
        RangeValuePattern.MinimumProperty.Id)
    {
        return rangeValuePattern.Current.Minimum;
    }
    if (automationProperty.Id ==
        RangeValuePattern.MaximumProperty.Id)
    {
        return rangeValuePattern.Current.Maximum;
    }
    if (automationProperty.Id ==
        RangeValuePattern.SmallChangeProperty.Id)
    {
        return rangeValuePattern.Current.SmallChange;
    }
    if (automationProperty.Id ==
        RangeValuePattern.LargeChangeProperty.Id)
    {
        return rangeValuePattern.Current.LargeChange;
    }
    if (automationProperty.Id ==
        RangeValuePattern.ValueProperty.Id)
    {
        return rangeValuePattern.Current.Value;
    }
    return null;
}
'''--------------------------------------------------------------------
''' <summary>
''' Gets the current property values from target.
''' </summary>
''' <param name="rangeValuePattern">
''' A RangeValuePattern control pattern obtained from 
''' an automation element representing a target control.
''' </param>
''' <param name="automationProperty">
''' The automation property of interest.
''' </param>
'''--------------------------------------------------------------------
Private Function GetRangeValueProperty( _
ByVal rangeValuePattern As RangeValuePattern, _
ByVal automationProperty As AutomationProperty) As Object
    If (rangeValuePattern Is Nothing Or _
    automationProperty Is Nothing) Then
        Throw New ArgumentException("Argument cannot be null.")
    End If

    If automationProperty.Id = _
    rangeValuePattern.MinimumProperty.Id Then
        Return rangeValuePattern.Current.Minimum
    End If
    If automationProperty.Id = _
    rangeValuePattern.MaximumProperty.Id Then
        Return rangeValuePattern.Current.Maximum
    End If
    If automationProperty.Id = _
    rangeValuePattern.SmallChangeProperty.Id Then
        Return rangeValuePattern.Current.SmallChange
    End If
    If automationProperty.Id = _
    rangeValuePattern.LargeChangeProperty.Id Then
        Return rangeValuePattern.Current.LargeChange
    End If
    If automationProperty.Id = _
    rangeValuePattern.ValueProperty.Id Then
        Return rangeValuePattern.Current.Value
    End If
    Return Nothing

End Function 'GetRangeValueProperty    

適用対象

こちらもご覧ください