KeyEventArgs::Key Property

 

Gets the keyboard key associated with the event.

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

public:
property Key Key {
	Key get();
}

Property Value

Type: System.Windows.Input::Key

The Key referenced by the event.

The following example creates a KeyEventHandler and checks whether the key associated with the KeyEventArgs is the Return key.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: