Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   OOP (https://www.clubdelphi.com/foros/forumdisplay.php?f=5)
-   -   OnKeyDown (https://www.clubdelphi.com/foros/showthread.php?t=14699)

scooterjgm 28-09-2004 18:06:43

OnKeyDown
 
como puedo controlar cuando se pulse la tecla CONTROL+SUPR??

ahora mismo lo tengo asi:

if key=VK_DELETE then
begin

pero con esto solo controlo la tecla SUPR...

Gracias!!

roman 28-09-2004 18:40:37

Fíjate en el parámetro Shift del evento OnKeyDown:

Código Delphi [-]
if (ssCtrl in Shift) and (Key = VK_DELETE) then

// Saludos

scooterjgm 29-09-2004 10:30:14

Muchas gracias Roman!! Funciona perfectamente :)

Un Saludo.

DarkBlue 28-06-2011 07:42:20

Cita:

Empezado por roman (Mensaje 64372)
Fíjate en el parámetro Shift del evento OnKeyDown:

Código Delphi [-]
if (ssCtrl in Shift) and (Key = VK_DELETE) then

// Saludos

como lo llamo desde otro procedimiento

Código Delphi [-]

procedure Tfcotizacion.Remplazar1Click(Sender: TObject);
var cap:string;
n:integer;

begin
 
 cap:= popupmenu1.Items.Items[0].Caption;
 stringgrid1.Cells[fcotizacion.col,row]:=cap;
 fcotizacion.OnKeyDown(sender,VK_CANCEL,//que va aqui??);


end;

gracias

olbeup 28-06-2011 08:03:30

Cita:

procedure Tfcotizacion.Remplazar1Click(Sender: TObject);
var cap:string;
n:integer;

begin

cap:= popupmenu1.Items.Items[0].Caption;
stringgrid1.Cells[fcotizacion.col,row]:=cap;
fcotizacion.OnKeyDown(sender,VK_CANCEL,//que va aqui??);


end;
Que tal éste código modificado
Código Delphi [-]
procedure TFCotizacion.Remplazar1Click(Sender: TObject);
var
  Cap: String;
  N:Integer;
  Key: Word;
begin
  Key := VK_CANCEL;
  Cap := PopupMenu1.Items.Items[0].Caption;
  StringGrid1.Cells[FCotizacion.Col, FCotizacion.Row] := Cap;
  FCotizacion.OnKeyDown(Sender, Key, []);
end;

Un saludo.


La franja horaria es GMT +2. Ahora son las 06:29:17.

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