Making Enter key act as Tab
To make the Enter key act as Tab key is a 3 step procedure:
1) Set the form's KeyPreview property to True
2) Set all form's buttons property Default to False
3) Create an OnKeyPress event for the form like this:
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then begin
Key := #0;
if (Sender is TDBGrid) then
TDBGrid(Sender).Perform(WM_KeyDown,VK_Tab,0)
else
Perform(Wm_NextDlgCtl,0,0);
end;
end;
Tip collaboration by: Antonio Carlos Maduro

0 Comments:
Post a Comment
<< Home