SetFocus Method

AutomationElement.SetFocus Method ()


Sets focus on the AutomationElement.

Namespace:   System.Windows.Automation
Assembly:  UIAutomationClient (in UIAutomationClient.dll)

public void SetFocus()

Exception Condition

The UI for the AutomationElement no longer exists.

The behavior of this method depends on the implementation by the UI Automation provider for the element. Setting focus does not necessarily bring the element to the foreground or make it visible.

.NET Framework
Available since 3.0
Return to top
© 2016 Microsoft