edit1的onkeydown中写
if key=vk_return then
........
在edit1的onkeypress中写:
if key=#13 then

解决方案 »

  1.   

    你可以看到在keypress中key为char表示你敲了那个健,改成这样一定有反映
    procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
    begin
    if key='w' then
      showmessage('1');
    end;
    敲W试试
      

  2.   

    procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
    begin
        if Key = #13 then
            Edit2.Text := Edit1.Text;
    end;
    一定行,我通过;
      

  3.   

    我的测试与 YANGLIU(人生不如意!)   相同!!
      

  4.   

    你可以通过设置BUTTON的DEFAULT属性为TRUE即可实现在EDIT按回车符后实现按了BUTTON的效果!!!(谢谢!)
      

  5.   

    以上方法是对的,你看看你的form的KeyPreview是不是设为TRUE了,把它设为FALSE再试试。
      

  6.   

    在edit的onkeydown中应该用
    if key=vk_return then
      ......