TablePattern.Pattern Field
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Identifies the TablePattern 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
In the following example, a TablePattern control pattern is obtained from a AutomationElement.
///--------------------------------------------------------------------
/// <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
This identifier is used by UI Automation client applications. UI Automation providers should use the equivalent field in TablePatternIdentifiers.
The pattern identifier is passed to methods such as GetCurrentPattern to retrieve the control pattern of interest from the specified AutomationElement.
Applies to
제품 | 버전 |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
.NET 피드백
.NET은(는) 오픈 소스 프로젝트입니다. 다음 링크를 선택하여 피드백을 제공해 주세요.