简单文本框问题 本人刚学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; cxgrid 合并单元格 acm噪音 有人用过DelphiNeroAPI吗? 怎样选择jpg gif图并与数据库互操作 fastreport的count函数为什么用不起来 TADOStoredProc调用oracle存储过程问题?急急!! 深圳朋友,请进...... 高分求解数据库问题,一表对多表的问题。敬请大家赐教!!(200分哟) 菜鸟提问:这样的查询怎么做?解答后立即给分! 初学delphi,想做个透明tbutton,方法不对请教各位。 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;