ScrollPattern.VerticalViewSizeProperty Campo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Identifica la proprietà VerticalViewSize.
public: static initonly System::Windows::Automation::AutomationProperty ^ VerticalViewSizeProperty;
public static readonly System.Windows.Automation.AutomationProperty VerticalViewSizeProperty;
staticval mutable VerticalViewSizeProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly VerticalViewSizeProperty As AutomationProperty
Valore del campo
Esempio
Nell'esempio seguente viene passato un elemento radice a una funzione che restituisce le dimensioni verticali e orizzontali correnti dell'area visualizzabile come percentuali dell'area del contenuto totale.
///--------------------------------------------------------------------
/// <summary>
/// Obtains the current vertical and horizontal sizes of the viewable
/// region as percentages of the total content area.
/// </summary>
/// <param name="targetControl">
/// The automation element of interest.
/// </param>
/// <returns>
/// The horizontal and vertical view sizes.
/// </returns>
///--------------------------------------------------------------------
private double[] GetViewSizes(AutomationElement targetControl)
{
if (targetControl == null)
{
throw new ArgumentNullException(
"AutomationElement argument cannot be null.");
}
double[] viewSizes = new double[2];
viewSizes[0] =
(double)targetControl.GetCurrentPropertyValue(
ScrollPattern.HorizontalViewSizeProperty);
viewSizes[1] =
(double)targetControl.GetCurrentPropertyValue(
ScrollPattern.VerticalViewSizeProperty);
return viewSizes;
}
'''--------------------------------------------------------------------
''' <summary>
''' Obtains the current vertical and horizontal sizes of the viewable
''' region as percentages of the total content area.
''' </summary>
''' <param name="targetControl">
''' The automation element of interest.
''' </param>
''' <returns>
''' The horizontal and vertical view sizes.
''' </returns>
'''--------------------------------------------------------------------
Private Overloads Function GetViewSizes( _
ByVal targetControl As AutomationElement) As Double()
If targetControl Is Nothing Then
Throw New ArgumentNullException( _
"AutomationElement argument cannot be null.")
End If
Dim viewSizes(1) As Double
viewSizes(0) = System.Convert.ToDouble( _
targetControl.GetCurrentPropertyValue( _
ScrollPattern.HorizontalViewSizeProperty))
viewSizes(1) = System.Convert.ToDouble( _
targetControl.GetCurrentPropertyValue( _
ScrollPattern.VerticalViewSizeProperty))
Return viewSizes
End Function 'GetViewSizes
Commenti
Questo identificatore viene usato dalle applicazioni client Automazione interfaccia utente. Automazione interfaccia utente provider devono usare il campo equivalente in ScrollPatternIdentifiers.