rt...

解决方案 »

  1.   

    在press事件里写上:
    if (char>48 and char<57) or (char>64 and char<102) then嘿嘿,大体上是吧!记不太清了
      

  2.   

    在KeyPress事件中:
    只输入数字:
    if not (key in ['0'..'9']) then
      key:=#0;
    只输入英文:
    if not ((key in ['a'..'z']) or (key in ['A','Z'])) then
      key;=#0;
      

  3.   

    {下面的函数是过滤掉空格键}
    function LeachSpacebar(key:char):char;
    begin  if ord(key)= 32 then key:=#0;  result:=key;end;用到ord()函数,其他的自己琢磨一下,说多了就没意思了