ScrollPattern.ScrollPatternInformation.HorizontalViewSize プロパティ

定義

現在の水平方向のビュー サイズを取得します。

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

プロパティ値

UI オートメーション要素内のコンテンツ エリア全体のパーセンテージで示した表示可能領域の水平方向のサイズ。 既定値は 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

適用対象