KeyDown, KeyUp Events

Measurement Studio User Interface

KeyDown, KeyUp Events

Syntax

Sub ControlName_KeyDown( KeyCode As Integer, Shift As Integer)

Sub ControlName_KeyUp( KeyCode As Integer, Shift As Integer)

Applies To

CWButton

CWGraph

CWKnob

CWNumEdit

CWSlide

Purpose

KeyUp generates when you release a key while the control has the input focus.

KeyDown generates when you press a key while the control has the input focus.

Remarks

For more information, refer to Visual Basic help.

Parameters

KeyCode As Integer

A code representing the key that was pressed. This code represents the key on the keyboard that was pressed rather than the ASCII value of the key. For example, pressing the <A> key produces the value 65. Pressing <@> or <SHIFT-2> produces the code for "2".

Shift As Integer

Specifies the state of the <SHIFT> key, <ALT> key, and <CTRL> key. The Shift argument can be any combination of the following values: 1 for <SHIFT> , 2 for <CTRL> , or 4 for <ALT> . For example, if the <SHIFT> and <CTRL> keys are pressed, the value is 3 (1 + 2).

See Also

KeyPress