简单文本框问题 本人刚学delphi,在一个文本框中,我要判断用户输入的是否为数字串,如果不是数字(含有字母或其他字符)我要给提示:让用户输入数字串.该怎么判断,有这样的函数吗?请指示.谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在onkeypress事件里写;if not (key in ['0'..'9'])thenbegin showmessage('请输入数字'); key:=chr(0);end; procedure Tform1.edit1KeyPress(Sender: TObject; var Key: Char);begin If ((key < '0') Or ( key > '9')) and (key <> chr(8)) then key := #0;end; 同意:在onkeypress事件里写;if not (key in ['0'..'9'])thenbegin showmessage('请输入数字'); key:=chr(0);end; 先谢谢了,输入小数点也可以,小数点或句号的ascll码值是多少啊? if not (key in ['0'..'9','.'])then 这个是可以输入小数点的begin showmessage('请输入数字'); key:=chr(0);end; 谁有个个风格的图标啊 求。。。 idhttp 提交asp.net 的问题 急在线等 拖拽问题(drag and drop) 急!在线等!关于进程间消息传递,谢谢 50分 LISTVIEW 导入 EXCEL中的问题????????????? 关于DELPHI用ADO调用ORACLE存储过程时的效率问题 请问各位大侠? 我是Delphi的新手,谁有关于线程的简单例子或者基本结构贴一贴了! 为什么实现不了模糊查询? 用什么样的FTP控件可以解决大文件传输。 CSDN开张了,发贴来BS一下 视频连接的问题
if not (key in ['0'..'9'])then
begin
showmessage('请输入数字');
key:=chr(0);
end;
var Key: Char);
begin
If ((key < '0') Or ( key > '9')) and (key <> chr(8)) then
key := #0;
end;
在onkeypress事件里写;
if not (key in ['0'..'9'])then
begin
showmessage('请输入数字');
key:=chr(0);
end;
begin
showmessage('请输入数字');
key:=chr(0);
end;