{*******************************************************} { } { Responsive Software http://www.responsive.co.nz } { } { Copyright (c) 2003-2006 Responsive Software Limited } { } {*******************************************************} unit Base; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TBaseForm = class(TForm) procedure StandardKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); private { Private declarations } public { Public declarations } procedure GoToNextControl; procedure GoToPrevControl; end; implementation {$R *.dfm} procedure TBaseForm.StandardKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin // if user presses enter then shift focus to control in frame if Key = VK_RETURN then begin GoToNextControl; Key := 0; end; end; procedure TBaseForm.GoToNextControl; begin FindNextControl(ActiveControl,true,true,false).SetFocus; end; procedure TBaseForm.GoToPrevControl; begin FindNextControl(ActiveControl,false,true,false).SetFocus; end; end.