tecla enter funcionando como tab

Delphi

26/08/2003

Usando a seguinte rotina é possivel usar a tecla enter com a função da tecla tab
if Key = #13 then
begin
Key := 0;
Perform(Wm_NextDlgCtl,0,0);
end;

Mas isso para td o form, e como faço para em determinados objetos como um DBMemo ou DBGrid (principalmente em DBMemo) a tecla enter voltar a funcionar como enter? esta codigo nao deu mto certo.....
if (Sender is TDBGrid) then
TDBGrid(Sender).Perform(WM_KeyDown,VK_Tab,0);


Greenmotez

Greenmotez

Curtidas 0

Respostas

Rodrigo Bergmann

Rodrigo Bergmann

26/08/2003

if not ((Sender is TDBGrid) or (Sender is TDBMemo)) then
  if Key = #13 then 
  begin 
    Key := 0; 
    Perform(Wm_NextDlgCtl,0,0); 
  end; 



GOSTEI 0
Eniorm

Eniorm

26/08/2003

Ae, eu coloquei um arquivo txt contendo uma procedure
para fazer tal feito, mas com vantagens especiais pois
vc programa uma vez soh.
vá em www.apocaliptica.hpg.com.br/hackz/delphi/
lá vc localiza o txt contendo todas as explicações!
T+


GOSTEI 0
POSTAR