An alternative to dropping a proper component or subclassing:

Using the Enter key to Tab
In Delphi the enter key does not normally move to the next field on a form
like Tab does. To make this happen, change the Forms KeyPreview property to
True, then place code like below into the Forms OnKeyPressEvent.


procedure TfrmMyForm.FormKeyPress(Sender: TObject; var Key: Char);
begin
  // If Enter key is pressed, disable the key and send the Tab key to the
form.
  // Note that the forms KeyPreview property must be True
  if Key = #13 then begin
    Key := #0;
    Perform (CM_DialogKey, VK_TAB, 0);
  end;
end;



A Shift Tab can be done with:
Perform(WM_NEXTDLGCTL,-1,0);

Rgds, Phil


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to