delphi Edit只能输入数字或小数点


本文整理自网络,侵删。

 
procedure Tfrmsystem.Edit8KeyPress(Sender: TObject; var Key: Char);
begin
  if (key<>#46) and ((key < #48) or (key > #57)) and (key <> #8) then//如果输入不是数字或小数点(#46代表小数点)
  begin
    key:=#0; //取消输入的内容(#0代表空值)
  end;
end;

相关阅读 >>

Delphi2010下安装控件Delphi

Delphi 获取汉字拼音首字母

Delphi 搜索字符串

Delphi 实现窗体随着鼠标移动

Delphi twebbrowser打开paypal出错

dephi获取系统常量

Delphi 字符串查找替换函数

Delphi indy控件实现网络验证与asp通信

Delphi tstringlist 排序 customsort

Delphi出现 no mapping for the unicode character exists in the target multi-byte code page 处理方法

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...