GridItemPattern.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 GridItemPattern 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
Field Value
Examples
In the following example, a GridItemPattern control pattern is obtained from an AutomationElement.
///--------------------------------------------------------------------
/// <summary>
/// Obtains a GridItemPattern control pattern from an
/// automation element.
/// </summary>
/// <param name="targetControl">
/// The automation element of interest.
/// </param>
/// <returns>
/// A GridItemPattern object.
/// </returns>
///--------------------------------------------------------------------
private GridItemPattern GetGridItemPattern(
AutomationElement targetControl)
{
GridItemPattern gridItemPattern = null;
try
{
gridItemPattern =
targetControl.GetCurrentPattern(
GridItemPattern.Pattern)
as GridItemPattern;
}
// Object doesn't support the
// GridPattern control pattern
catch (InvalidOperationException)
{
return null;
}
return gridItemPattern;
}
'''--------------------------------------------------------------------
''' <summary>
''' Obtains a GridItemPattern control pattern from an
''' automation element.
''' </summary>
''' <param name="targetControl">
''' The automation element of interest.
''' </param>
''' <returns>
''' A GridItemPattern object.
''' </returns>
'''--------------------------------------------------------------------
Private Function GetGridItemPattern( _
ByVal targetControl As AutomationElement) As GridItemPattern
Dim gridItemPattern As GridItemPattern = Nothing
Try
gridItemPattern = DirectCast( _
targetControl.GetCurrentPattern(gridItemPattern.Pattern), _
GridItemPattern)
Catch exc As InvalidOperationException
' Object doesn't support the
' GridPattern control pattern
Return Nothing
End Try
Return gridItemPattern
End Function 'GetGridItemPattern
Remarks
This identifier is used by UI Automation client applications. UI Automation providers should use the equivalent field in GridItemPatternIdentifiers.
The pattern identifier is passed to methods such as GetCurrentPattern to retrieve the control pattern of interest from the specified AutomationElement.
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET