procedure TForm1.EditKeyPress(Sender: TObject; var Key: Char);
begin
if key = #13 then
key := #0;
end;
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
TmpCtrl: TWinControl;
ETmp: TKeyPressEvent;
begin
if key = 13 then
begin
TmpCtrl := ActiveControl;
if TmpCtrl is TCustomMemo then exit;
if TmpCtrl is TEdit then
begin
if assigned(TEdit(TmpCtrl).onKeyPress) then
ETmp:= TEdit(TmpCtrl).OnKeyPress;
TEdit(TmpCtrl).OnKeyPress := EditKeyPress;
end;
repeat
TmpCtrl:= FindNextControl(TmpCtrl,true,true,false);
until (TmpCtrl is TCustomEdit) or
(TmpCtrl is TCustomComboBox) or
(TmpCtrl is TCustomListBox) or
(TmpCtrl is TCustomCheckBox) or
(TmpCtrl is TRadioButton);
if TmpCtrl is TEdit then
begin
if assigned(ETmp) then
TEdit(TmpCtrl).OnKeyPress := ETmp;
end;