←Select platform

KeyDown Event

Summary

An event that triggers when a key is pressed when your control has focus.

Syntax

C#
VB
C++
public event KeyEventHandler KeyDown 
  
Event KeyDown As KeyEventHandler 
event KeyEventHandler^ KeyDown 

Event Data

The event handler receives an argument of type KeyEventArgs containing data related to this event. The following KeyEventArgs properties provide information specific to this event.

PropertyDescription
Alt Gets a value indicating whether the ALT key was pressed.
Control Gets a value indicating whether the CTRL key was pressed.
Handled Gets or sets a value indicating whether the event was handled.
KeyCode Gets the keyboard code for a System.Windows.Forms.Control.KeyDown or System.Windows.Forms.Control.KeyUp event.
KeyData Gets the key data for a System.Windows.Forms.Control.KeyDown or System.Windows.Forms.Control.KeyUp event.
KeyValue Gets the keyboard value for a System.Windows.Forms.Control.KeyDown or System.Windows.Forms.Control.KeyUp event.
Modifiers Gets the modifier flags for a System.Windows.Forms.Control.KeyDown or System.Windows.Forms.Control.KeyUp event. The flags indicate which combination of CTRL, SHIFT, and ALT keys was pressed.
Shift Gets a value indicating whether the SHIFT key was pressed.
SuppressKeyPress Gets or sets a value indicating whether the key event should be passed on to the underlying control.
Remarks

If your control is derived from the standard System.Windows.Forms.Control, then you do not need to implement this event (since the default System.Windows.Forms.Control.KeyDown will be used).

Example

For an example, refer to IAnnAutomationControl.

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations Assembly