por favor, o mais rápido possível

Delphi

11/02/2003

Olá pessoal


como faço para que o enter funcione como o tab?

obrigado pela ajuda..


:shock:


Lfernando

Lfernando

Curtidas 0

Respostas

Anonymous

Anonymous

11/02/2003

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


GOSTEI 0
Carnette

Carnette

11/02/2003

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;


GOSTEI 0
POSTAR