急!keypress 问题

急!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 09:51  delphi2007  阅读(119)  评论(0编辑  收藏  举报