แก้ไข

แชร์ผ่าน


UIElement.OnAccessKey(AccessKeyEventArgs) Method

Definition

Provides class handling for when an access key that is meaningful for this element is invoked.

protected:
 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)

Parameters

e
AccessKeyEventArgs

The event data to the access key event. 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.

Remarks

There is no actual AccessKey event in the UIElement class, or elsewhere, which you can raise or attach handlers for. 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.

Notes to Inheritors

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.

Applies to