有两个edit文本框:edit1,edit2
当在edit1中的pressdown事件中写入代码:
 if key = 13 then  //回车时把焦点放到edit2
   begin
     edit2.setfocus;
   end;
发现电脑音箱会发出'当'的一声,如何避免发出这种信息音。

解决方案 »

  1.   

    这个问题昨天还有人问if key = 13 then  //回车时把焦点放到edit2
       begin
         edit2.setfocus;
         Key:= #0;   // 看看管用不
       end;
      

  2.   

    if key = #13 then  
       begin
         edit2.setfocus;
       end;
      

  3.   

    刚看了一下把事件改成 OnKeyPress ,用OnkeyDown不行if ord(key) = 13 then  //回车时把焦点放到edit2
       begin
         edit2.setfocus;
         Key:= #0;   // 
       end;