ScrollPattern.ScrollPatternInformation.HorizontalScrollPercent Propiedad

Definición

Obtiene la posición de desplazamiento horizontal actual.

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

Valor de propiedad

Posición de desplazamiento horizontal como porcentaje del área total de contenido del elemento de automatización de la interfaz de usuario. El valor predeterminado es 0.0.

Ejemplos

En el ejemplo siguiente, un ScrollPattern objeto obtenido de un control de destino se pasa a una función que recupera los porcentajes de desplazamiento horizontal y vertical actuales de la región visible dentro del área de contenido.

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

Se aplica a