Aracılığıyla paylaş


ScrollPattern.HorizontalViewSizeProperty Alan

Tanım

Özelliğini tanımlar HorizontalViewSize .

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

Alan Değeri

Örnekler

Aşağıdaki örnekte, görüntülenebilir bölgenin geçerli dikey ve yatay boyutlarını toplam içerik alanının yüzdeleri olarak döndüren bir işleve bir kök öğesi geçirilir.

///--------------------------------------------------------------------
/// <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

Açıklamalar

Bu tanımlayıcı, UI Otomasyonu istemci uygulamaları tarafından kullanılır. UI Otomasyonu sağlayıcıları içindeki eşdeğer alanı ScrollPatternIdentifierskullanmalıdır.

Şunlara uygulanır

Ayrıca bkz.