当前的焦点在DBEdit1.SetFocus;在运行TForm1.FormKeyPressd中获取下一个焦点,每个DBEdit的TabOrder的值都已经设置好,在按“enter”后,光标没有移动,还是在DBEdit1上,代码如下:
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
   SelectNext(activecontrol,true,true);end;

解决方案 »

  1.   

    findnextcontrol(activecontrol,false,false,false).SetFocus;向前
    findnextcontrol(activecontrol,true,false,false).setfocus;向后
      

  2.   

      if Key = #13 then
      begin
        Key := #0;
        perform(WM_NEXTDLGCTL,0,0);
      end;
      

  3.   

    沒說清楚,呵呵
    findnextcontrol(activecontrol,false,false,false).SetFocus;回退,由edit2->edit1
    findnextcontrol(activecontrol,true,false,false).setfocus;向前,由edit1->edit2
      

  4.   

    设置窗体的KeyPreview := True了吗?
      

  5.   

    学习学习!
    为什么不在DBEdit1的ONEXIT事件中写呢?