GridPattern.Pattern Feld

Definition

Bezeichnet das GridPattern-Steuerelementmuster.Identifies the GridPattern control pattern.

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 

Feldwert

AutomationPattern

Beispiele

Im folgenden Beispiel wird ein- GridPattern Steuerelement Muster aus einem Benutzeroberflächenautomatisierungs-Element abgerufen.In the following example, a GridPattern control pattern is obtained from a UI Automation element.

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

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

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

    Try
        gridPattern = DirectCast( _
        targetControl.GetCurrentPattern( _
        gridPattern.Pattern), GridPattern)
    Catch exc As InvalidOperationException
        ' Object doesn't support the 
        ' GridPattern control pattern
        Return Nothing
    End Try

    Return gridPattern
End Function 'GetGridPattern    

Hinweise

Dieser Bezeichner wird von Benutzeroberflächenautomatisierungs-Client Anwendungen verwendet.This identifier is used by UI Automation client applications. Benutzeroberflächenautomatisierungs-Anbieter sollten das entsprechende Feld in verwenden GridPatternIdentifiers .UI Automation providers should use the equivalent field in GridPatternIdentifiers.

Der Muster Bezeichner wird an Methoden wie z GetCurrentPattern . b. zurückgegeben, um das gewünschte Steuerelement Muster aus dem angegebenen abzurufen AutomationElement .The pattern identifier is passed to methods such as GetCurrentPattern to retrieve the control pattern of interest from the specified AutomationElement.

Gilt für: