ScrollPattern.ScrollPatternInformation.HorizontalViewSize Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém o tamanho atual da vista horizontal.
public:
property double HorizontalViewSize { double get(); };
public double HorizontalViewSize { get; }
member this.HorizontalViewSize : double
Public ReadOnly Property HorizontalViewSize As Double
Valor de Propriedade
O tamanho horizontal da região visível como percentagem da área total de conteúdo dentro do elemento Automatização da Interface de Utilizador. O valor padrão é 100.0.
Exemplos
No exemplo seguinte, um ScrollPattern objeto obtido a partir de um controlo de alvo é passado para uma função que recupera os tamanhos verticais e horizontais atuais da região visível como percentagens da área total de conteúdo.
///--------------------------------------------------------------------
/// <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