Google

Wednesday, March 14, 2007

making the Enter Key act like Tab

procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
if
Key = #13 then
begin
Key := #0;
{ check if SHIFT - Key is pressed }
if GetKeyState(VK_Shift) and $8000 <> 0 then
PostMessage(Handle, WM_NEXTDLGCTL, 1, 0)
else
PostMessage(Handle, WM_NEXTDLGCTL, 0, 0);
end;
end;

// Form1.KeyPreview := True !

No comments: