ButtonBase.OnKeyUp(KeyEventArgs) 方法

定義

提供 KeyUp 路由事件的類別處理,當這個控制項取得焦點時使用者放開按鍵便會發生。Provides class handling for the KeyUp routed event that occurs when the user releases a key while this control has focus.

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

參數

e
KeyEventArgs

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

備註

此執行會 KeyUp 將事件資料的 Handled 屬性設定為,以便在 true 使用者放開空格鍵時,將事件標示為已處理。This implementation marks the KeyUp event as handled by setting the Handled property of the event data to true when the user releases the SPACEBAR. 否則,此執行不會將已處理的狀態變更 (Handled 事件資料的屬性) KeyUpOtherwise, this implementation does not change the handled state (the Handled property) of the KeyUp event data.

給繼承者的注意事項

如果您覆寫 OnKeyUp(KeyEventArgs) ,請一律呼叫您的實作為基底執行 OnKeyUp(KeyEventArgs)If you override OnKeyUp(KeyEventArgs), always call the base implementation in your OnKeyUp(KeyEventArgs) 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.

適用於