Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Trucos (https://www.clubdelphi.com/foros/forumdisplay.php?f=52)
-   -   Simular el avance y retroceso del tabulador (https://www.clubdelphi.com/foros/showthread.php?t=80435)

Acanol 08-06-2006 11:50:28

Simular el avance y retroceso del tabulador
 
Podemos crear un evento OnkeyPress y asi movernos por los distintos Controles, con las teclas deseadas

(Ej.: (+),(-)).

Código Delphi [-]
procedure TForm*.OnKeyPress(Sender: TObject; var Key: Char);
begin
 If Key =#45 Then Begin //#45= '-'
     keybd_event(16,0,0,0); // SHIFT presionado
     keybd_event(9,0,0,0); // TAB presionado
     Keybd_event(16,0,2,0); // Soltar el SHIFT  (NO SE PUEDE OMITIR)
     keybd_event(9,0,2,0); // TAB Released (Puede ser omitido)
     Key := #0
   end;
 if key=#43 then begin //#43='+'
    keybd_event(9,0,0,0); // TAB presionado
    keybd_event(9,0,2,0); // Soltar el Tab
    Key:=#0;
 end;
end;


La franja horaria es GMT +2. Ahora son las 19:30:19.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi