Roman, utilizar solo la tecla Supr fué una imposición. Respecto a la programación en los ancestros, todos los maestros, heredan de un formulario que a parte de otras características estéticas tiene programado el evento OnKeyPress de la siguiente manera:
Código:
procedure TPapiFRM.FormKeyPress(Sender: TObject; var Key: Char);
begin
begin
//Pulsacion de ENTER
if Key = #13 then
begin
if not (ActiveControl is TDBGrid) and
not (ActiveControl is TButton) and
not (ActiveControl is TdbMemo) and
not (ActiveControl is TDBCtrlGrid) then
begin {si no es un DBGrid}
Key := #0;{nos comemos la pulsación del enter}
Perform(WM_NEXTDLGCTL, 0, 0);{movemos al siguiente}
end
else
begin
if (ActiveControl is TDBGrid) then
begin
with TDBGrid(ActiveControl) do
if selectedindex < (fieldcount -1) then
selectedindex := selectedindex +1
else
selectedindex := 0;
end;
end;
end;
end;
end;
En cuanto al formulario que contiene al DBCtrlGrid no tiene ninguna programación especial respecto al tratamiento de teclas, solo la heredada del código anterior.
Gracias.