Export (0) Print
Expand All
1 out of 2 rated this helpful - Rate this topic

KeyEventArgs.KeyData Property

Gets the key data for a KeyDown or KeyUp event.

[Visual Basic]
Public ReadOnly Property KeyData As Keys
[C#]
public Keys KeyData {get;}
[C++]
public: __property Keys get_KeyData();
[JScript]
public function get KeyData() : Keys;

Property Value

A Keys value representing the key code for the key that was pressed, combined with modifier flags that indicate which combination of CTRL, SHIFT, and ALT keys were pressed at the same time.

Remarks

You can use constants from Keys to extract information from the KeyData property. Use the bitwise AND operator to compare data returned by KeyData with constants in Keys to obtain information about which keys the user pressed. To determine whether a specific modifier key was pressed, use the Control, Shift, and Alt properties.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

KeyEventArgs Class | KeyEventArgs Members | System.Windows.Forms Namespace | KeyCode | KeyValue

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.