Partilhar via


ScrollPattern.ScrollPatternInformation.VerticalScrollPercent Propriedade

Definição

Obtém a posição de rolagem vertical atual.

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

Valor da propriedade

Double

A posição de rolagem vertical como uma porcentagem da área de conteúdo total dentro do elemento Automação da Interface do Usuário. O valor padrão é 0,0.

Exemplos

No exemplo a seguir, um ScrollPattern objeto obtido de um controle de destino é passado para uma função que recupera os percentuais de rolagem horizontal e vertical atuais da região visível dentro da área de conteúdo.

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

Aplica-se a