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 None

適用於

另請參閱