GetFocused Method
This documentation is archived and is not being maintained.

AccessibleObject.GetFocused Method

Retrieves the object that has the keyboard focus.

[Visual Basic]
Public Overridable Function GetFocused() As AccessibleObject
public virtual AccessibleObject GetFocused();
public: virtual AccessibleObject* GetFocused();
public function GetFocused() : AccessibleObject;

Return Value

An AccessibleObject that specifies the currently focused child. This method returns the calling object if the object itself is focused. Returns a null reference (Nothing in Visual Basic) if no object has focus.


Exception Type Condition
COMException The control cannot be retrieved.


The concept of keyboard focus is related to that of an active window. An active window is the foreground window in which the user is working. The object with the keyboard focus is either the active window or a child object of the active window.

Only one object or item within a container can have the focus at any one time. The object with the keyboard focus is not necessarily the selected object.

Notes to Inheritors:  All objects that can receive the keyboard focus must support this property.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

AccessibleObject Class | AccessibleObject Members | System.Windows.Forms Namespace | GetChild

© 2016 Microsoft