procedure TForm1.Edt_NumKeyPress(Sender: TObject; var Key: Char);
begin
If not (key in [#48..#57]) then
begin
key:= #0;
ShowMessage('只能输入数字');
end
end;
begin
If not (key in [#48..#57]) then
begin
key:= #0;
ShowMessage('只能输入数字');
end
end;
刚遇到这个问题就发上来了 这个".."真好用啊
记住在你的edit编辑框里面在KeyPress里面加入代码哦!