ContentElement.LostFocus ContentElement.LostFocus ContentElement.LostFocus ContentElement.LostFocus Event

定義

此元素失去邏輯焦點時發生。Occurs when this element loses logical focus.

public:
 event System::Windows::RoutedEventHandler ^ LostFocus;
public event System.Windows.RoutedEventHandler LostFocus;
member this.LostFocus : System.Windows.RoutedEventHandler 
Public Custom Event LostFocus As RoutedEventHandler 

備註

如果使用方法呼叫刻意強制焦點,但上一個鍵盤焦點存在於不同範圍中,則邏輯焦點會與鍵盤焦點不同。Logical focus differs from keyboard focus if focus is deliberately forced away by using a method call but the previous keyboard focus exists in a different scope. 在此案例中,鍵盤焦點會維持其所在位置和項目其中Focus方法呼叫仍取得邏輯焦點。In this scenario, keyboard focus remains where it is, and the element where a Focus method is called still gets logical focus.

此事件的更精確地解譯時,就是引發時間的值IsFocused路由的項目屬性變更時從truefalseA more precise interpretation of this event is that it is raised when the value of the IsFocused property of an element in the route changes from true to false.

因為此事件會使用事件反昇的路由,失去焦點的項目可能的子項目,而非項目實際附加事件處理常式。Because this event uses bubbling routing, the element that loses focus might be a child element instead of the element where the event handler is actually attached. 檢查Source事件資料來判斷實際取得焦點的項目中。Check the Source in the event data to determine the actual element that gained focus.

路由事件資訊Routed Event Information

識別項欄位Identifier field LostFocusEvent
路由策略Routing strategy 事件反昇Bubbling
Delegate - 委派Delegate RoutedEventHandler
  • 沒有任何對應的通道事件。There is no corresponding tunneling event.

  • 覆寫OnLostFocus實作在衍生類別中這個事件的類別處理。Override OnLostFocus to implement class handling for this event in derived classes.

適用於

另請參閱