在onkeypress里
if key = #13 then

解决方案 »

  1.   

    在控件的“KeyPress”事件中处理如:
    Procedure Tform1.Edit1.KeyPress(Sender: TObject; var Key: Char);
    begin
      if key=#13 then Edit2.SetFocus;   //如果按下了回车就把光标定位在
                                              //Edit2上面
    end;不知你说的是不是这种情况???
      

  2.   

    按下enter键,就响应按键事件
      

  3.   

    Procedure Tform1.Edit1.KeyPress(Sender: TObject; var Key: Char);
    begin
      if key=#13 then 
        Do_You_Event;// 在这里写你要做的自定义事件就的了   end;