本文整理匯總了VB.NET中System.Windows.Automation.PropertyConditionFlags枚舉的典型用法代碼示例。如果您正苦於以下問題:VB.NET PropertyConditionFlags枚舉的具體用法?VB.NET PropertyConditionFlags怎麽用?VB.NET PropertyConditionFlags使用的例子?那麽, 這裏精選的枚舉代碼示例或許可以為您提供幫助。
在下文中一共展示了PropertyConditionFlags枚舉的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: FindChildElement
''' <summary>
''' Find a UI Automation child element by ID.
''' </summary>
''' <param name="controlName">Name of the control, such as "button1"</param>
''' <param name="rootElement">Parent element, such as an application window, or the
''' AutomationElement.RootElement when searching for the application window.</param>
''' <returns>The UI Automation element.</returns>
Private Function FindChildElement(ByVal controlName As String, ByVal rootElement As AutomationElement) _
As AutomationElement
If controlName = "" OrElse rootElement Is Nothing Then
Throw New ArgumentException("Argument cannot be null or empty.")
End If
' Set a property condition that will be used to find the main form of the
' target application. In the case of a WinForms control, the name of the control
' is also the AutomationId of the element representing the control.
Dim propCondition As New PropertyCondition(AutomationElement.AutomationIdProperty, _
controlName, PropertyConditionFlags.IgnoreCase)
' Find the element.
Return rootElement.FindFirst(TreeScope.Element Or TreeScope.Children, propCondition)
End Function 'FindChildElement