UIElement.IsKeyboardFocused UIElement.IsKeyboardFocused UIElement.IsKeyboardFocused UIElement.IsKeyboardFocused Property

定义

获取一个值,该值表示该元素是否具有键盘焦点。Gets a value indicating whether this element has keyboard focus. 这是依赖项属性。This is a dependency property.

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

属性值

如果此元素具有键盘焦点,则为 true;否则为 falsetrue if this element has keyboard focus; otherwise, false. 默认值为 falseThe default is false.

实现

注解

对此属性的确定值所做的更改可能伴随着与焦点相关的事件。Changes to the determined value of this property may be accompanied by focus-related events.

IsKeyboardFocusedIsKeyboardFocusWithin通常用于其他输入相关事件的类事件处理程序中, 例如, 用于确定元素是否已具有键盘焦点, 或在鼠标事件和键盘事件发生关联时做出决定。IsKeyboardFocused and IsKeyboardFocusWithin are commonly used within class event handlers for other input-related events, for instance to determine whether the element already has keyboard focus, or to make determinations when mouse events and keyboard events occur in conjunction.

依赖项属性信息Dependency Property Information

标识符字段Identifier field IsKeyboardFocusedProperty
元数据属性设置为trueMetadata properties set to true NoneNone

适用于

另请参阅