Mega Code Archive

 
Categories / Delphi / ADO Database
 

Change with enter to the next field in a DBGrid

Title: change with enter to the next field in a DBGrid? procedure TForm1.DBGrid1KeyPress(Sender: TObject; var Key: Char); begin if Key = #13 then begin if DBGrid1.Columns.Grid.SelectedIndex then DBGrid1.Columns[DBGrid1.Columns.grid.SelectedIndex + 1].Field.FocusControl else begin Table1.Next; DBGrid1.Columns[0].field.FocusControl; end; end; end;