在edit的keypress事件中加入:
begin
if not (key in['0'..'9', '.', #8, #27, #13]) then
key := #0;//只能为数字
if (Pos('.', edit.Text) > 0) and (key = '.')then
key := #0;//只能有一个小数点
if (Pos('0', edit.Text) = 1) and (key = '0') and (edit.SelStart = 1) then
key := #0;//当第一位为0时第二位不能输入0
end;