UIElement.HasEffectiveKeyboardFocus 屬性


取得值,指出 UIElement 是否具有焦點。Gets a value that indicates whether the UIElement has focus.

protected public:
 virtual property bool HasEffectiveKeyboardFocus { bool get(); };
protected internal virtual bool HasEffectiveKeyboardFocus { get; }
member this.HasEffectiveKeyboardFocus : bool
Protected Friend Overridable ReadOnly Property HasEffectiveKeyboardFocus As Boolean


如果 UIElement 具有焦點,則為 true;否則為 falsetrue if the UIElement has focus; otherwise, false.


子類別可以覆寫這個屬性,以指定元素何時具有鍵盤焦點。Subclasses can override this property to specify when the element has keyboard focus. 當您的 UIElement 包含可擁有鍵盤焦點的專案,而您想要讓元素回報焦點時,這會很有用。This is useful when your UIElement contains elements that can have keyboard focus and you want your element to report that it has focus.