Uses
Grids
procedure
TfrmPri.MudarComEnter(var Msg: TMsg; var Handled: Boolean);
begin
If not ((Screen.ActiveControl is TCustomMemo)
or
(Screen.ActiveControl is TCustomGrid) or
(Screen.ActiveForm.ClassName = 'TMessageForm'))
then
begin
If Msg.message = WM_KEYDOWN then
begin
Case Msg.wParam of
VK_RETURN,VK_DOWN :
Screen.ActiveForm.Perform(WM_NextDlgCtl,0,0);
VK_UP :
Screen.ActiveForm.Perform(WM_NextDlgCtl,1,0);
end;
end;
end;
end;
No evento
OnCreate o Form Principal digite a seguinte linha
Application.OnMessage := MudarComEnter;