Expand Minimize

UIElement.OnAccessKey Method

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

Namespace:  System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)

protected virtual void OnAccessKey(
	AccessKeyEventArgs e
)

Parameters

e
Type: System.Windows.Input.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.

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.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft