Enter键使用作Tab键

首先,在主窗体中声明以下private过程:
procedure TMainForm.DoEnterAsTab(var Msg: TMsg; var Handled: Boolean);
begin
if Msg.Message = WM_KEYDOWN then
begin
if Msg.wParam = VK_RETURN then
Keybd_event(VK_TAB, 0, 0, 0);
end; //if
end;

在主窗体的OnCreate事件中加入:
Application.OnMessage := DoEnterAsTab;

 
原文地址:https://www.cnblogs.com/hnxxcxg/p/2941049.html