delphi2007 教程

delphi2007 教程

首页 新随笔 联系 聚合 管理
  1013 Posts :: 0 Stories :: 28 Comments :: 0 Trackbacks
急!keypress 问题 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiDB/html/delphi_20061222105416169.html
if   (Key   <#48)or   ((Key   >#57)and   (Key   <#65))or   ((Key   >#90)and   (Key   <#97))   or   (Key   >#122)   then  
                Key   :=#0  
   
  不能输入汉字,该怎麽改?我要求只能输入字母,数字,汉字。  
  本人不清楚   key   值,请赐教。

procedure   TForm1.Edit1KeyPress(Sender:   TObject;   var   Key:   Char);  
  begin  
      if   not   ((Key   <   #32)   or   (Key   in   ['0'..'9',   'a'..'z',   'A'..'Z'])   or   (Key   >   #127))   then  
          Key   :=   #0;  
  end;  
 

posted on 2008-12-11 10:09 delphi2007 阅读(350) 评论(0)  编辑 收藏 引用
只有注册用户登录后才能发表评论。