本文整理自网络,侵删。
判断字符串是否包含限制以外的字符 否则置空procedure TMainForm.cbSearchExit(Sender: TObject); //判断退出事件varJ:Integer;K:String;begin K := TsEdit(Sender).Text;for J:=1 to Length(K) do beginif not(K[J] in ['0'..'9','a'..'z','A'..'Z']) then beginTsEdit(Sender).Text:='';end;end;end;可以使用下列方法将不符合的字符突出显示出来TsEdit(ctl).SelectAllTsEdit(ctl).SelLengthTsEdit(ctl).SelStartTsEdit(ctl).SelText――――――――――――――――
原文链接:https://blog.csdn.net/u010431493/article/details/79785430
相关阅读 >>
Delphi fileopendialog1 多选加载大量文件,不受中文文件名影响
Delphi tdsauthenticationmanager的用法
Delphi 10.3 中安装程序自动升级插件autoupgrader_pro_v5.2
idftp tencoding and iidtextencoding
更多相关阅读请进入《Delphi》频道 >>