.NET Framework Class Library
Keyboard..::.PreviewKeyDown Attached Event

Occurs when a key on the keyboard is pressed.

Namespace:  System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Syntax

Visual Basic (Declaration)
See AddPreviewKeyDownHandler, RemovePreviewKeyDownHandler
Visual Basic (Usage)
See AddPreviewKeyDownHandler, RemovePreviewKeyDownHandler
C#
See AddPreviewKeyDownHandler, RemovePreviewKeyDownHandler
Visual C++
See AddPreviewKeyDownHandler, RemovePreviewKeyDownHandler
JScript
See AddPreviewKeyDownHandler, RemovePreviewKeyDownHandler
XAML Attribute Usage
<object Keyboard.PreviewKeyDown="KeyEventHandler" .../>
Routed Event Information

Identifier field

PreviewKeyDownEvent

Routing strategy

Tunneling

Delegate

KeyEventHandler

  • The corresponding bubbling event is KeyDown.

Remarks

This is an attached event. WPF implements attached events as routed events. Attached events are fundamentally a XAML language concept for referencing events that can be handled on objects that do not define that event, which WPF expands upon by also enabling the event to traverse a route. Attached events do not have a direct handling syntax in code; to attach handlers for a routed event in code, you use a designated Add*Handler method. For details, see Attached Events Overview.

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5, 3.0
See Also

Reference

Other Resources

Tags :


Page view tracker