有很多edit框,用up,down,left,right控制游标在这些编辑框里移动

解决方案 »

  1.   

    procedure Tfrm_borrow.Edit2KeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    begin
      inherited;
      if (key=40) and (DBGridEh2.Visible) and (Not QPart.IsEmpty) then
      begin
        Edit2.OnExit:=nil;
        DBGridEh2.SetFocus;
        QPart.First;
      end;
    end;  这是down key=38 是UP
      

  2.   

    再说要每个edit框里写程序,不是很累吗。我那个船体里有42个edit框
      

  3.   

    获得当前Edit的flag( 你可以设置一个tag来记录)
    然后up,down left right ,根据计算用SetFocus来更换Edit的焦点