Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   OOP (https://www.clubdelphi.com/foros/forumdisplay.php?f=5)
-   -   F1..F12 con PageControl (https://www.clubdelphi.com/foros/showthread.php?t=82731)

Parsec 08-04-2013 01:21:48

F1..F12 con PageControl
 
Buenas señores,as,

como puedo capturar las teclas F1..F12 en un componente PageControl?

Saludos

ecfisa 08-04-2013 01:55:14

Hola Parsec.

Un modo puede ser:
Código Delphi [-]
procedure TForm1.FormCreate(Sender: TObject);
begin
  KeyPreview := True
end;

// Uso:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if ActiveControl is TPageControl then
    case Key of
      VK_F1 : ShowMessage('Tecla F1 presionada');
      //...
      VK_F12: ShowMessage('Tecla F12 presionada');
    end
end;

Saludos.

Parsec 08-04-2013 12:02:25

Perfecto!!!,

muchas gracias Ecfisa.


La franja horaria es GMT +2. Ahora son las 12:45:53.

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