當前位置: 首頁>>代碼示例>>VB.NET>>正文


VB.NET PropertyConditionFlags枚舉代碼示例

本文整理匯總了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
開發者ID:VB.NET開發者,項目名稱:System.Windows.Automation,代碼行數:22,代碼來源:PropertyConditionFlags


注:本文中的System.Windows.Automation.PropertyConditionFlags枚舉示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。