UIElement.OnAccessKey(AccessKeyEventArgs) UIElement.OnAccessKey(AccessKeyEventArgs) UIElement.OnAccessKey(AccessKeyEventArgs) UIElement.OnAccessKey(AccessKeyEventArgs) Method


當叫用對這個項目有意義的便捷鍵 (Access Key) 時,為其提供類別處理。Provides class handling for when an access key that is meaningful for this element is invoked.

 virtual void OnAccessKey(System::Windows::Input::AccessKeyEventArgs ^ e);
protected virtual void OnAccessKey (System.Windows.Input.AccessKeyEventArgs e);
abstract member OnAccessKey : System.Windows.Input.AccessKeyEventArgs -> unit
override this.OnAccessKey : System.Windows.Input.AccessKeyEventArgs -> unit
Protected Overridable Sub OnAccessKey (e As AccessKeyEventArgs)


AccessKeyEventArgs AccessKeyEventArgs AccessKeyEventArgs AccessKeyEventArgs

便捷鍵事件的事件資料。The event data to the access key event. 該事件資料會報告叫用哪個便捷鍵,並指出控制這些事件之傳送的 AccessKeyManager 物件,是否也會將這個便捷鍵引動過程傳送至其他項目。The event data reports which key was invoked, and indicate whether the AccessKeyManager object that controls the sending of these events also sent this access key invocation to other elements.


在任何實際 AccessKey 事件UIElement類別,或其他位置,您可以引發,或附加的處理常式。There is no actual AccessKey event in the UIElement class, or elsewhere, which you can raise or attach handlers for. 相反地,透過專用的管理員類別,產生事件AccessKeyManager後, 置處理所有的輸入来搜尋適用於整個輸入模型的存取金鑰。Instead, the event is originated via a dedicated manager class, AccessKeyManager, which post-processes all input to search for access keys that are applicable to the entire input model.


在這個方法的預設實作UIElement設定鍵盤焦點設定至這個項目 (藉由呼叫Focus())。The default implementation of this method in UIElement sets keyboard focus to this element (by calling Focus()). 如果它們是可設定焦點,因為它是針對協助工具案例的預期的行為,實作應永久保存此行為。Implementations should perpetuate this behavior if they are focusable, because it is an expected behavior for accessibility scenarios. 請注意,基底實作不使用傳遞的事件資料執行任何動作,而且會引發任何進一步的事件;它只會將焦點。Note that the base implementation does nothing with the passed event data and raises no further event; it just sets the focus.