DelphiFAQ Home Search:
General :: Programming :: Delphi :: VCL
About the Delphi VCL (Visual Component Library)

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

This is the FULL list of all articles in this category.

Featured Article

Making Enter key act as Tab

To make the Enter key act as Tab key is a 3 step procedure:

  1. Set the form's KeyPreview property to True
  2. Set all form's buttons property Default to false
  3. Create an OnKeyPress event for the form like this:
 procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char); 
 begin 
   if Key = #13 then begin 
     Key := #0; 
     if (Sender is TDBGrid) then 
       TDBGrid(Sender).Perform(WM_KeyDown,VK_Tab,0) 
     else 
       Perform(Wm_NextDlgCtl,0,0); 
   end; 
 end; 
 

Generated 16:01:53 on Oct 17, 2019