你知道什么是“当当当当当当当”吗?当当当当当当当就是“Only you .......”
不要在OnKeyDown中进行控制,在OnKeyPress中试试,呵呵

解决方案 »

  1.   

    上面说的不错哦,确实是事件的原因哦。送上代码让你看看。。分数拿来哦。
      procedure TForm1.EditKeyPress(Sender: TObject; var Key: Char); 
      begin 
        if key = #13 then key := #0; 
      end; 
      
      procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; 
        Shift: TShiftState); 
      var 
        ACtrl: TWinControl; 
        k: TKeyPressEvent; 
      begin 
      
        if key = 13 then 
          begin 
            ACtrl := ActiveControl; 
            if ACtrl is TCustomMemo then exit; 
      
            if ACtrl is TEdit then 
              begin 
                if assigned(TEdit(ACtrl).onKeyPress) then 
                  k:= TEdit(ACtrl).OnKeyPress; 
                TEdit(ACtrl).OnKeyPress := EditKeyPress; 
              end; 
      
            repeat 
              ACtrl:= FindNextControl(ACtrl,true,true,false); 
            until (ACtrl is TCustomEdit) or 
            (ACtrl is TCustomComboBox) or 
            (ACtrl is TCustomListBox) or 
            (ACtrl is TCustomCheckBox) or 
            (ACtrl is TRadioButton);   
            if ACtrl is TEdit then 
              begin 
                if assigned(K)  then 
                  TEdit(ACtrl).OnKeyPress := K; 
              end;   
            ACtrl.SetFocus ; 
          end;   
      end;
      

  2.   

    是不是有些控件不接受keydown事件?
      

  3.   

    TEdit(ACtrl).OnKeyPress := EditKeyPress; 
    这句事什么意思 ?EditKeyPress哪里来的?
      

  4.   

    就是回车事件啦。。自己写的过程啦。也可以写成BUTTON1。CLICK
      

  5.   

    就是前面写的过程啦。。
    procedure TForm1.EditKeyPress(Sender: TObject; var Key: Char); 
    这么大竟然没有看见???