if not(CharInSet(Key, ['0'..'9',#8])) then key:=#0; //数字
if not(CharInSet(Key, ['a'..'z',#8])) then key:=#0; //小写字母
if not(CharInSet(Key, ['A'..'Z',#8])) then key:=#0; //大写字母
if (key = '.') and (Pos('.',Edit.Text) > 0) then key := #0; //只能输入一个小数点