TeeGrid and tab

TeeGrid VCL / FMX for Embarcadero RAD Studio, Delphi, C++ Builder and Lazarus Free Pascal.
Post Reply
stoffman
Newbie
Newbie
Posts: 14
Joined: Wed Dec 29, 2021 12:00 am

TeeGrid and tab

Post by stoffman » Wed Nov 02, 2022 6:23 am

How can I prevent the "tab" key to move between cells?

I want to reserve "tab" and "shift+tab" to move the focus between the controls on the form. not within the grid itself.

Thanks.

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeGrid and tab

Post by Yeray » Fri Nov 04, 2022 1:47 pm

Hello,

You could try to skip the event as follows:

Code: Select all

type TTeeGridAccess=class(TTeeGrid);

procedure TForm1.FormCreate(Sender: TObject);
begin
  // ...
  TTeeGridAccess(TeeGrid1).OnKeyDown:=GridKeyDown;
end;

procedure TForm1.GridKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if Key=VK_TAB then
  begin
    Key:=VK_ESCAPE;
  end;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply