我想在edit中只能输入数字而不能写入字母,但不知道怎么设置或改变哪个属性,高手请指点!!我只想用edit控件!! 我想在edit中只能输入数字而不能写入字母,但不知道怎么设置或改变哪个属性,高手请指点!!我只想用edit控件!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 if key<=chr(9) and key>=chr(0) then 你的代码else key=#0 OnKeyPress中加代码,还要加上小数字。 在OnKeyPress中 if not (key in ['0'..'9',#13,#8]) then begin key:=#0; end; 在OnKeyPress中 if not (key in ['0'..'9',#13,#8, '-','.']) then begin key:=#0; end; if key<=chr(9) and key>=chr(0) then your codeelse key=#0 在Edit的OnKeyPress事件中添加以下代码:if not (Key in ['0'..'9']) then Key:=#0; procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);begin if not (key in ['0'..'9']) then key:=chr(0);end; to pazee(耙子) 控制一下,两个“-”,两个“.” ,“-”的位置 文本框 验证不能为空 send里面的buf转换hex数据? cxgrid中怎么加入行号?怎么固定行号 关于image的loadfromfile的问题提 手机发送短信问题,使用AT+CMGS指令短信发送成功后,如何去掉手机的状态显示? 请教数据存取问题。 修改客户端数据,服务器上怎么改不了呢? 打印走纸,设置纸张问题,急 CBX RIA框架炮轰传统Delphi三层构架 程序老死机 关于RichEdit1 有谁知道itpub的登录密码是什么?
你的代码
else
key=#0
if not (key in ['0'..'9',#13,#8]) then
begin
key:=#0;
end;
if not (key in ['0'..'9',#13,#8, '-','.']) then
begin
key:=#0;
end;
your code
else
key=#0
begin
if not (key in ['0'..'9']) then
key:=chr(0);
end;
控制一下,两个“-”,两个“.” ,“-”的位置