ScrollPattern.HorizontalScrollPercentProperty 필드

정의

HorizontalScrollPercent 속성을 식별합니다.

public: static initonly System::Windows::Automation::AutomationProperty ^ HorizontalScrollPercentProperty;
public static readonly System.Windows.Automation.AutomationProperty HorizontalScrollPercentProperty;
 staticval mutable HorizontalScrollPercentProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly HorizontalScrollPercentProperty As AutomationProperty 

필드 값

AutomationProperty

예제

다음 예제에서는 루트 요소를 콘텐츠 영역 내에서 표시 가능 영역의 현재 가로 및 세로 스크롤 백분율을 반환 하는 함수에 전달 됩니다.

///--------------------------------------------------------------------
/// <summary>
/// Obtains the current scroll positions of the viewable region 
/// within the content area.
/// </summary>
/// <param name="targetControl">
/// The automation element of interest.
/// </param>
/// <returns>
/// The horizontal and vertical scroll percentages.
/// </returns>
///--------------------------------------------------------------------
private double[] GetScrollPercentages(AutomationElement targetControl)
{
    if (targetControl == null)
    {
        throw new ArgumentNullException(
            "AutomationElement argument cannot be null.");
    }

    double[] percentage = new double[2];

    percentage[0] =
        (double)targetControl.GetCurrentPropertyValue(
        ScrollPattern.HorizontalScrollPercentProperty);

    percentage[1] =
         (double)targetControl.GetCurrentPropertyValue(
         ScrollPattern.VerticalScrollPercentProperty);

    return percentage;
}
'''--------------------------------------------------------------------
''' <summary>
''' Obtains the current scroll positions of the viewable region 
''' within the content area.
''' </summary>
''' <param name="targetControl">
''' The automation element of interest.
''' </param>
''' <returns>
''' The horizontal and vertical scroll percentages.
''' </returns>
'''--------------------------------------------------------------------
Private Function GetScrollPercentages( _
ByVal targetControl As AutomationElement) As Double()
    If targetControl Is Nothing Then
        Throw New ArgumentNullException( _
        "AutomationElement argument cannot be null.")
    End If

    Dim percentage(1) As Double

    percentage(0) = System.Convert.ToDouble( _
    targetControl.GetCurrentPropertyValue( _
    ScrollPattern.HorizontalScrollPercentProperty))

    percentage(1) = System.Convert.ToDouble( _
    targetControl.GetCurrentPropertyValue( _
    ScrollPattern.VerticalScrollPercentProperty))

    Return percentage

End Function 'GetScrollPercentages

설명

이 식별자는 UI 자동화 클라이언트 애플리케이션에서 사용 됩니다. UI 자동화 공급자의 해당 필드를 사용 해야 ScrollPatternIdentifiers합니다.

적용 대상

추가 정보