delphi 只能输入数字和小数点到编辑框内,屏蔽其他字符的输入

Procedure  numonly(key :char);

begin

if (not (Key in ['0'..'9'])        //数字

        and (Key <> '.') and (Key <> #8) ) then //小数点和退回键

    begin

        Key :=#0;

end;

end;

posted @ 2010-07-08 08:11  鸽子888  阅读(192)  评论(0编辑  收藏  举报