TEdit enter lazarus / 31-LCL ---------------------------------------------------------------------- captian jaster · 2010-09-20 17:50 How do I set a Tedit so that when ENTER is pressed something is done.. ---------------------------------------------------------------------- typo · 2010-09-20 18:14 On the OnKeyPress event of the TEdit: Code: [Select]if Key = #13 then Do; ---------------------------------------------------------------------- JuhaManninen · 2010-09-21 15:42 Even easier: Code: [Select]Edit1.Default := True; Juha ---------------------------------------------------------------------- mas steindorff · 2010-09-21 16:46 Quote from: JuhaManninen on September 21, 2010, 05:42:49 pmEven easier: Code: [Select]Edit1.Default := True; this is one I've not seen before and I get "no member" error when I try.  can you elaborate? ---------------------------------------------------------------------- captian jaster · 2010-09-21 17:02 Quote from: JuhaManninen on September 21, 2010, 05:42:49 pmEven easier: Code: [Select]Edit1.Default := True; Juha Same here... I also have another question... I have a TMemo box and a TEdit in my Form.. How can I make so that when the form loads the cursor automatically loads into the TEdit and not the TMemo ---------------------------------------------------------------------- typo · 2010-09-21 17:22 Code: [Select]Form.ActiveControl := Edit; Or set it on the Object Inspector. ---------------------------------------------------------------------- captian jaster · 2010-09-21 17:24 Quote from: typo on September 21, 2010, 07:22:58 pmCode: [Select]Form.ActiveControl := Edit; Thank you ---------------------------------------------------------------------- JuhaManninen · 2010-09-21 22:15 Quote from: mas steindorff on September 21, 2010, 06:46:13 pmthis is one I've not seen before and I get "no member" error when I try.  can you elaborate? Ok, damn. "Default" property belongs to TButton, not TEdit. Sorry. Must have been a short-circuit in my head. Not the first time. For TEdit you must use OnKeyPress indeed. "Default" property works well for TButton though. You hit Enter and the button's action is fired. Juha ---------------------------------------------------------------------- krexon · 2010-09-22 07:07 Quote from: typo on September 21, 2010, 07:22:58 pmCode: [Select]Form.ActiveControl := Edit; Or set it on the Object Inspector. You can also do in that way: Code: [Select]edit1.setfocus; You can replace 'edit1' with combobox, labelededit and so on...