AutomationElement.IsEnabledProperty 欄位

定義

IsEnabled識別 屬性,指定是否啟用 所參考 AutomationElement 的使用者介面 (UI) 專案。

public: static initonly System::Windows::Automation::AutomationProperty ^ IsEnabledProperty;
public static readonly System.Windows.Automation.AutomationProperty IsEnabledProperty;
 staticval mutable IsEnabledProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly IsEnabledProperty As AutomationProperty 

欄位值

AutomationProperty

範例

下列範例會擷取 屬性的目前值。 如果元素未提供預設值,則會傳回預設值。

bool isControlEnabled = (bool)
   autoElement.GetCurrentPropertyValue(AutomationElement.IsEnabledProperty);
Dim isControlEnabled As Boolean = _
    CBool(autoElement.GetCurrentPropertyValue(AutomationElement.IsEnabledProperty))

備註

消費者介面自動化用戶端應用程式會使用此識別碼。 消費者介面自動化提供者應該使用 中的 AutomationElementIdentifiers 對等識別碼。

您也可以從 CurrentCached 屬性擷取這個屬性。

屬性的傳回值的類型為 Boolean 。 屬性的預設值為 false

當控制項的啟用狀態為 false 時,會假設子控制項也不會啟用。 當父控制項的狀態變更時,您不應該預期子項目的屬性變更事件。

適用於

另請參閱