Share via


ScrollItemPattern.Pattern Campo

Definición

Identifica el patrón de control ScrollItemPattern.

public: static initonly System::Windows::Automation::AutomationPattern ^ Pattern;
public static readonly System.Windows.Automation.AutomationPattern Pattern;
 staticval mutable Pattern : System.Windows.Automation.AutomationPattern
Public Shared ReadOnly Pattern As AutomationPattern 

Valor de campo

AutomationPattern

Ejemplos

En el ejemplo siguiente, se obtiene un ScrollItemPattern patrón de control de .AutomationElement

///--------------------------------------------------------------------
/// <summary>
/// Obtains a ScrollItemPattern control pattern from an 
/// automation element.
/// </summary>
/// <param name="targetControl">
/// The automation element of interest.
/// </param>
/// <returns>
/// A ScrollItemPattern object.
/// </returns>
///--------------------------------------------------------------------
private ScrollItemPattern GetScrollItemPattern(
    AutomationElement targetControl)
{
    ScrollItemPattern scrollItemPattern = null;

    try
    {
        scrollItemPattern =
            targetControl.GetCurrentPattern(
            ScrollItemPattern.Pattern)
            as ScrollItemPattern;
    }
    // Object doesn't support the ScrollItemPattern control pattern
    catch (InvalidOperationException)
    {
        return null;
    }

    return scrollItemPattern;
}
'''--------------------------------------------------------------------
''' <summary>
''' Obtains a ScrollItemPattern control pattern from an 
''' automation element.
''' </summary>
''' <param name="targetControl">
''' The automation element of interest.
''' </param>
''' <returns>
''' A ScrollItemPattern object.
''' </returns>
'''--------------------------------------------------------------------
Private Function GetScrollItemPattern( _
ByVal targetControl As AutomationElement) As ScrollItemPattern
    Dim scrollItemPattern As ScrollItemPattern = Nothing

    Try
        scrollItemPattern = DirectCast( _
        targetControl.GetCurrentPattern( _
        scrollItemPattern.Pattern), ScrollItemPattern)
    Catch
        ' Object doesn't support the ScrollItemPattern control pattern
        Return Nothing
    End Try

    Return scrollItemPattern

End Function 'GetScrollItemPattern

Comentarios

Este identificador lo usan Automatización de la interfaz de usuario aplicaciones cliente. Automatización de la interfaz de usuario proveedores deben usar el campo equivalente en ScrollItemPatternIdentifiers.

El identificador de patrón se pasa a métodos como GetCurrentPattern para recuperar el patrón de control de interés del especificado AutomationElement.

Se aplica a