por favor, o mais rápido possível
11/02/2003
0
Olá pessoal
como faço para que o enter funcione como o tab?
obrigado pela ajuda..
:shock:
como faço para que o enter funcione como o tab?
obrigado pela ajuda..
:shock:
Lfernando
Curtir tópico
+ 0
Responder
Posts
11/02/2003
Anonymous
No evento OnKeyPress do form coloque o seguinte codigo:
if key = #13 then
begin
Key:= 0;
Perform(Wm_NextDlgCtl,0,0);
end;
Em properties comolque TRUE em Key Preview
if key = #13 then
begin
Key:= 0;
Perform(Wm_NextDlgCtl,0,0);
end;
Em properties comolque TRUE em Key Preview
Responder
11/02/2003
Carnette
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;
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;
Responder
Clique aqui para fazer login e interagir na Comunidade :)