Export (0) Print
Expand All

AccessibleObject.GetFocused Method

Retrieves the object that has the keyboard focus.

[Visual Basic]
Public Overridable Function GetFocused() As AccessibleObject
[C#]
public virtual AccessibleObject GetFocused();
[C++]
public: virtual AccessibleObject* GetFocused();
[JScript]
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.

Exceptions

Exception Type Condition
COMException The control cannot be retrieved.

Remarks

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.

Requirements

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

Show:
© 2014 Microsoft