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 无dll版下载者

Delphi实现拖动无标题窗口的5种方法

Delphi 根据分割符只取最后的值

Delphi simple resource api replacement

Delphi 设置webbrowser 代理服务器 与 useragent

Delphi 启动程序隐藏主窗体

Delphi 以二进制方式读取图片保存到string

Delphi getfileversion 获取文件版本

Delphi idhttp的用法

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



打赏

取消

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

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

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

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

评论

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