ScrollPattern.VerticalViewSizeProperty フィールド

定義

VerticalViewSize プロパティを識別します。Identifies the VerticalViewSize property.

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

フィールド値

次の例では、ルート要素は、表示可能な領域の現在の垂直方向と水平方向のサイズを、全体のコンテンツ領域のパーセンテージとして返す関数に渡されます。In the following example, a root element is passed to a function that returns the current vertical and horizontal sizes of the viewable region as percentages of the total content area.

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

    double[] viewSizes = new double[2];

    viewSizes[0] =
        (double)targetControl.GetCurrentPropertyValue(
        ScrollPattern.HorizontalViewSizeProperty);

    viewSizes[1] =
         (double)targetControl.GetCurrentPropertyValue(
         ScrollPattern.VerticalViewSizeProperty);

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

    Dim viewSizes(1) As Double

    viewSizes(0) = System.Convert.ToDouble( _
    targetControl.GetCurrentPropertyValue( _
    ScrollPattern.HorizontalViewSizeProperty))

    viewSizes(1) = System.Convert.ToDouble( _
    targetControl.GetCurrentPropertyValue( _
    ScrollPattern.VerticalViewSizeProperty))

    Return viewSizes

End Function 'GetViewSizes

注釈

この識別子は、UI オートメーションクライアントアプリケーションによって使用されます。This identifier is used by UI Automation client applications. UI オートメーションプロバイダーでは、のScrollPatternIdentifiers同等のフィールドを使用する必要があります。UI Automation providers should use the equivalent field in ScrollPatternIdentifiers.

適用対象

こちらもご覧ください