語言

ScrollPattern.ScrollPatternInformation.VerticalViewSize 屬性

定義

會得到目前的垂直視圖大小。

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

屬性值

可檢視區域在 使用者介面自動化 元素中佔總內容區域百分比的垂直大小。 預設值為 100.0。

範例

在以下範例中, ScrollPattern 從目標控制取得的物件會被傳遞到一個函式中,該函式以總內容區域的百分比形式取得可觀察區域目前的垂直與水平大小。

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

    double[] viewSizes = new double[2];

    viewSizes[0] =
        scrollPattern.Current.HorizontalViewSize;

    viewSizes[1] =
         scrollPattern.Current.VerticalViewSize;

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

    Dim viewSizes(1) As Double

    viewSizes(0) = scrollPattern.Current.HorizontalViewSize

    viewSizes(1) = scrollPattern.Current.VerticalViewSize

    Return viewSizes

End Function 'GetViewSizes

適用於