ButtonBase.OnMouseLeave(MouseEventArgs) 方法

定義

提供 MouseLeave 路由事件的類別處理,當滑鼠離開項目時便會發生。Provides class handling for the MouseLeave routed event that occurs when the mouse leaves an element.

protected:
 override void OnMouseLeave(System::Windows::Input::MouseEventArgs ^ e);
protected override void OnMouseLeave (System.Windows.Input.MouseEventArgs e);
override this.OnMouseLeave : System.Windows.Input.MouseEventArgs -> unit
Protected Overrides Sub OnMouseLeave (e As MouseEventArgs)

參數

e
MouseEventArgs

MouseLeave 事件的事件資料。The event data for the MouseLeave event.

備註

MouseLeave Handled trueClickMode 設定為時 Hover ,這個執行會將事件資料的屬性設為,藉此將事件標記為已處理。This implementation marks the MouseLeave event as handled by setting the Handled property of the event data to true when ClickMode is set to Hover.

給繼承者的注意事項

如果您覆寫 OnMouseLeave(MouseEventArgs) ,請一律呼叫您的實作為基底執行 OnMouseLeave(MouseEventArgs)If you override OnMouseLeave(MouseEventArgs), always call the base implementation in your OnMouseLeave(MouseEventArgs) implementation. 若無法呼叫基底,會使基類無法使用類別處理常式來處理事件,這可能會變更最終類別的執行時間行為。Failure to call the base implementation prevents base classes from handling the event with a class handler, which might change the run-time behavior of the final class. 視您的需求而定,您可以在特殊處理前後呼叫基底執行。You can call the base implementation either before or after your special handling, depending on your requirements.

適用於