ScrollPattern.VerticalViewSizeProperty Field

 

Identifies the VerticalViewSize property.

Namespace:   System.Windows.Automation
Assembly:  UIAutomationClient (in UIAutomationClient.dll)

public static readonly AutomationProperty VerticalViewSizeProperty

This identifier is used by UI Automation client applications. UI Automation providers should use the equivalent field in ScrollPatternIdentifiers.

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;
}

.NET Framework
Available since 3.0
Return to top
Show: