Page 1 of 1

Tab movement suppresion in edit mode

Posted: Fri Jan 12, 2018 6:22 pm
by 18682546
Is there an easy way to suppress the movement from the tab key when in edit mode like there is for the enter key?
I have tried using FormKeyDown logic but it seems to work only every other time the tab key is pressed.

Re: Tab movement suppresion in edit mode

Posted: Thu Jan 18, 2018 12:04 pm
by 18682546
I have managed to disable the tab movement but have now noticed that use of the arrow keys does not generate any events. How can I track which cell of the grid the user has arrowed to?

Re: Tab movement suppresion in edit mode

Posted: Mon Jan 22, 2018 8:58 am
by yeray
Hello,

I've been able to fire an event when the TAB key is pressed while editing a cell. The problem is the IEditor control in TVCLTeeGrid is "private" and to use it we will have to move it to "protected":

Code: Select all

    procedure CMDialogKey(Var Msg: TWMKey); message CM_DIALOGKEY;

Code: Select all

type TVCLTeeGridAccess=class(TVCLTeeGrid);

procedure TFormGridDataset.CMDialogKey(Var Msg: TWMKEY);
begin
  if (Msg.CharCode = VK_TAB) and (ActiveControl = TVCLTeeGridAccess(TeeGrid1.Grid).IEditor) then
     ShowMessage('TAB key pressed');

  inherited;
end;