TablePattern.Pattern Feld

Definition

Bezeichnet das TablePattern-Steuerelementmuster.

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

Beispiele

Im folgenden Beispiel wird ein TablePattern Steuerelementmuster aus einem AutomationElementabgerufen.

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

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

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

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

    Return tablePattern

End Function 'GetTablePattern

Hinweise

Dieser Bezeichner wird von Benutzeroberflächenautomatisierung Clientanwendungen verwendet. Benutzeroberflächenautomatisierung Anbieter sollten das entsprechende Feld in TablePatternIdentifiersverwenden.

Der Musterbezeichner wird an Methoden übergeben, z GetCurrentPattern . B. zum Abrufen des gewünschten Steuerelementmusters aus dem angegebenen AutomationElement.

Gilt für:

Weitere Informationen