语言

UIElement.IsKeyboardFocused 属性

定义

获取一个值,该值指示此元素是否具有键盘焦点。 这是依赖项属性。

public:
 property bool IsKeyboardFocused { bool get(); };
public bool IsKeyboardFocused { get; }
member this.IsKeyboardFocused : bool
Public ReadOnly Property IsKeyboardFocused As Boolean

属性值

true 如果此元素具有键盘焦点,则为否则,为 false. 默认值为 false。

实现

注解

此属性的确定值更改可能伴随着与焦点相关的事件。

IsKeyboardFocused 并且 IsKeyboardFocusWithin 通常用于类事件处理程序中的其他输入相关事件,例如确定元素是否已具有键盘焦点,或确定鼠标事件和键盘事件何时同时发生。

Dependency 属性信息

项目 价值
标识符字段 IsKeyboardFocusedProperty
元数据属性设置为 true None

适用于

另请参阅