faqts : Computers : Programming : Languages : C++

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

15 of 54 people (28%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

How do I detect keypress 'Enter' in a TEdit component?

Feb 16th, 2006 01:48
Ashley Ward, Jonathan Baker, search.borland.com


It can be done via your properties functions on keydown or it can be 
done by reading key input code eg. "if (inkey == 0100) then process"
--------------------------------------------------
In the OnKeyDown event of the TEdit type:

if (Key == VK_RETURN)
{
   Key = NULL;
   DoSomething();
}
---------------------------------------------------
if (Key == VK_RETURN)
{
   Key = NULL;
   DoSomething();
}
--------------------------------

Good Luck