Delphi 通过api强制TEdit仅接受数字输入


本文整理自网络,侵删。

 
procedure SetEditNumeric(Handle: THandle);
begin
  SetWindowLong(Handle, GWL_STYLE,
    GetWindowLong(Handle, GWL_STYLE) or ES_NUMBER);
end;


//点击按钮后,edit1 只能输入数字
procedure TForm2.Button1Click(Sender: TObject);

begin
SetEditNumeric(edit1.Handle);
end;

相关阅读 >>

Delphi控件安装与删除

Delphi写com+的心得体会

Delphi tstreamwriter tstreamreader 流操作3

Delphi 按字符串长度对tstringlist的元素进行排序

Delphi假死线程堵塞解决办法

Delphi 限制文本框中只接受数字

Delphi idhttp1 xmlpost

Delphi concat 字符串函数

Delphi tdbgrideh导出excel

Delphi自动提交网页表单和获取框架网页源码

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



打赏

取消

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

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

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

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

评论

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