RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDBMemo.KeyPress Method

KeyPress overrides the inherited method to handle any keystrokes that alter the state of the edit control.

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

KeyPress first calls the inherited method, which calls the OnKeyPress event handler. Next, KeyPress checks the value of the key, and throws it away if it is not a valid character for the field type, or if there is no link to a database field. Valid characters cause KeyPress to attempt to put the dataset into edit mode.  

If the field for the memo control is a text BLOB, pressing the Pause key causes KeyPress to call the LoadMemo method. Pressing the Escape key causes KeyPress to throw away unposted edits. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!