RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomListBox.KeyPress Method

Responds when the user presses a key.

Pascal
procedure KeyPress(var Key: Char); override;
C++
virtual __fastcall KeyPress(Char Key);

KeyPress is called automatically when the list box receives a key-press message (WM_CHAR). It generates an OnKeyPress event, and then, if the AutoComplete property is true, updates ItemIndex to reflect the next character that the user typed. 

The Key parameter is the character represented by the key that is pressed, not a Windows virtual key code. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!