How do I use Enter key i/o Tab to traverse between textboxes in a form lazarus / 34-Windows ---------------------------------------------------------------------- Goodman H__ · 2010-05-22 02:38 Greetings to everybody! In Delphi I can write code in form's keyPress event(set form's keypreview:=true): Code: [Select]if key=#13 then perform(wm_nextDlgCtrl,0,0); end; How can I do the same in FP?And what's the cross-platform solution also? Thanks a lot for your help in advance. Regards, Sam ---------------------------------------------------------------------- theo · 2010-05-22 02:46 Code: [Select]uses LCLType; procedure TForm1.FormKeyDown(Sender:TObject;var Key:Word;Shift:TShiftState); begin   if Key=VK_Return then SelectNext(ActiveControl,True,True); end; ---------------------------------------------------------------------- zeljko · 2010-05-22 04:02 Quote from: Goodman H__ on May 22, 2010, 04:38:01 amGreetings to everybody! In Delphi I can write code in form's keyPress event(set form's keypreview:=true): Code: [Select]if key=#13 then perform(wm_nextDlgCtrl,0,0); end; How can I do the same in FP?And what's the cross-platform solution also? if Key = #13 then   SelectNext(ActiveControl, True, True) Regards, Sam ---------------------------------------------------------------------- Goodman H__ · 2010-05-22 04:51 Quote from: theo on May 22, 2010, 04:46:42 amCode: [Select]uses LCLType; procedure TForm1.FormKeyDown(Sender:TObject;var Key:Word;Shift:TShiftState); begin   if Key=VK_Return then SelectNext(ActiveControl,True,True); end; Thank you.It works. But there is a little difference.Based on the above code,all controls can traverse by enter key with no problem,but when nagivate to a button,press enter does not fire the button's event,just go to the next control.If I want to fire the button's event,I need to press blank key.Not the same in delphi though,but it works.