AutomationElement.HasKeyboardFocusProperty Fält

Definition

Identifierar egenskapen HasKeyboardFocus .

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

Fältvärde

Exempel

I följande exempel hämtas det aktuella värdet för egenskapen. Standardvärdet returneras om elementet inte tillhandahåller något.

bool hasFocus = (bool)
   autoElement.GetCurrentPropertyValue(AutomationElement.HasKeyboardFocusProperty);
Dim hasFocus As Boolean = CBool(autoElement.GetCurrentPropertyValue(AutomationElement.HasKeyboardFocusProperty))

Kommentarer

Den här identifieraren används av UI Automation klientprogram. UI Automation providers bör använda motsvarande identifierare i AutomationElementIdentifiers.

Den här egenskapen kan också hämtas från Current egenskaperna eller Cached .

Returvärden för egenskapen är av typen Boolean. Standardvärdet för egenskapen är false.

Gäller för

Se även