Export (0) Print
Expand All
Expand Minimize

AccessibleObject.GetFocused Method

Retrieves the object that has the keyboard focus.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public virtual AccessibleObject GetFocused ()
public AccessibleObject GetFocused ()
public function GetFocused () : AccessibleObject
Not applicable.

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 typeCondition

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.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft