Compartir a través de


ScrollPattern.ScrollPatternInformation.HorizontalViewSize Propiedad

Definición

Obtiene el tamaño de la vista horizontal actual.

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

Valor de propiedad

Tamaño horizontal de la región visible como porcentaje del área total de contenido del elemento de Automatización de la interfaz de usuario. El valor predeterminado es 100,0.

Ejemplos

En el ejemplo siguiente, un ScrollPattern objeto obtenido de un control de destino se pasa a una función que recupera los tamaños verticales y horizontales actuales de la región visible como porcentajes del área de contenido total.

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

Se aplica a