Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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
)
protected void OnAccessKey (
	AccessKeyEventArgs e
)
protected function OnAccessKey (
	e : AccessKeyEventArgs
)
You cannot use methods in XAML.

Parameters

e

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.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft