PDA

Ver la Versión Completa : OnKeyDown


scooterjgm
28-09-2004, 18:06:43
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:


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
Fíjate en el parámetro Shift del evento OnKeyDown:


if (ssCtrl in Shift) and (Key = VK_DELETE) then


// Saludos

como lo llamo desde otro procedimiento



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
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

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.