AccessibleObject.GetFocused AccessibleObject.GetFocused AccessibleObject.GetFocused AccessibleObject.GetFocused Method

定义

检索具有键盘焦点的对象。Retrieves the object that has the keyboard focus.

public:
 virtual System::Windows::Forms::AccessibleObject ^ GetFocused();
public virtual System.Windows.Forms.AccessibleObject GetFocused ();
abstract member GetFocused : unit -> System.Windows.Forms.AccessibleObject
override this.GetFocused : unit -> System.Windows.Forms.AccessibleObject
Public Overridable Function GetFocused () As AccessibleObject

返回

AccessibleObject,指定当前已设定焦点的子级。An AccessibleObject that specifies the currently focused child. 如果对象本身设定了焦点,此方法返回调用对象。This method returns the calling object if the object itself is focused. 如果没有对象具有焦点,则返回 nullReturns null if no object has focus.

异常

无法检索控件。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.

继承者说明

所有可以接收键盘焦点的对象都必须支持此属性。All objects that can receive the keyboard focus must support this property.

适用于

另请参阅