|
First, declare the following private procedure in the main form:
{------}
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;
{------}
Add in the OnCreate event of the main form:
{------}
Application.OnMessage: = DoEnterAsTab;
{------}
During the running of the program, WM_KEYDOWN information is continuously received. If the key pressed is VK_RETURN (# 13), we simulate a keyboard event and pass VK_TAB as a parameter. Works throughout the program. |
|