在OnkeyUp事件中进行处理:
procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (activecontrol=button1) and (key=13)
then key:=32;
end;
procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (Form1.ActiveControl is TButton) and (key=13)
then key:=32;
end;