Procedure numonly(key :char);
begin
if (not (Key in ['0'..'9']) //数字
and (Key <> '.') and (Key <> #8) ) then //小数点和退回键
Key :=#0;
end;