Aracılığıyla paylaş


ScrollPattern.ScrollPatternInformation.VerticalScrollPercent Özellik

Tanım

Geçerli dikey kaydırma konumunu alır.

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

Özellik Değeri

Double

UI Otomasyonu öğesi içindeki toplam içerik alanının yüzdesi olarak dikey kaydırma konumu. Varsayılan değer 0,0'dır.

Örnekler

Aşağıdaki örnekte, hedef denetimden alınan bir ScrollPattern nesne, içerik alanı içindeki görüntülenebilir bölgenin geçerli yatay ve dikey kaydırma yüzdelerini alan bir işleve geçirilir.

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

    double[] percentage = new double[2];

    percentage[0] =
        scrollPattern.Current.HorizontalScrollPercent;

    percentage[1] =
         scrollPattern.Current.VerticalScrollPercent;

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

    Dim percentage(1) As Double

    percentage(0) = scrollPattern.Current.HorizontalScrollPercent

    percentage(1) = scrollPattern.Current.VerticalScrollPercent

    Return percentage

End Function 'GetScrollPercentagesFromPattern

Şunlara uygulanır