RangeValuePattern.MinimumProperty 字段
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
标识 Minimum 属性。
public: static initonly System::Windows::Automation::AutomationProperty ^ MinimumProperty;
public static readonly System.Windows.Automation.AutomationProperty MinimumProperty;
staticval mutable MinimumProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly MinimumProperty As AutomationProperty
字段值
示例
在以下示例中, RangeValuePattern 从目标控件获取的对象将传递到检索当前 RangeValuePattern 属性值的函数中。
///--------------------------------------------------------------------
/// <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
注解
此标识符由UI 自动化客户端应用程序使用。 UI 自动化提供程序应使用等效字段。RangeValuePatternIdentifiers