转换问题 一个edit1 一个DBedit1我是用procedure TDPFrom.Edit1Change(Sender: TObject);来将edit1的数据传到DBEdit1的,但我要的是edit1是整数来的,我要怎样写代码才能检测到 edit1 的数据是整数呢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 var value: Integer;if tryStrToInt(Edit1.text, value) then 你的代码 在Edit的KeyPress事件中添加如下代码: if (Key = #8) or (Key = #127) then Exit; if (Key < '0') or (Key > '9') then Key := #10;确保edit中输入的只能是数字 (Sender: TObject;var Key: Char);//禁止不是数字的按键begin if not (Key in ['0'..'9',#8]) then key:=#0;end; if not (key in ['0'..'9',#8]) then key := #0; 请教:字符 ' 如何在delphi 字符串中表示? 请问是什么决自定义事件会出现在object inspector的event中的? 在字符串中找到指定的字符及出现的位置用哪个语句 请大家谈谈关于底层登录技术 关于Excel的问题 紧急求助!!!欢迎高手帮助小弟,感激不尽!!!!!!!! TClientSocket不断尝试与TServerSocket连接,运行一段时间后的问题! 关于dll接口的声明问题。。 为什么我的delphi5一运行就死机? 请指教!!! 请问如何设置系统默认打印机的当前纸张类型 论“抵制日货”应该缓行。
value: Integer;if tryStrToInt(Edit1.text, value) then
你的代码
if (Key = #8) or (Key = #127) then
Exit;
if (Key < '0') or (Key > '9') then
Key := #10;
确保edit中输入的只能是数字
begin
if not (Key in ['0'..'9',#8]) then
key:=#0;
end;