delphi 在memo查找字符并定位


本文整理自网络,侵删。

 var
SearchText:string;
k:integer;
begin
SearchText:='ABC'; //查找edit1中输入的文本
k:=pos(SearchText,memo1.Text); //求出首次出现SearchText的位置
if k=0 then
//showmessage('找不到')
else
begin
memo1.SelStart:=k;
memo1.SelLength:=length(SearchText);
memo1.SetFocus; //这一句很重要,否则就会看不到文字被选中
end;

相关阅读 >>

Delphi 的 webservice 的 cookie 操作

Delphi 时间与相关类型(3): tfiletime、tsystemtime 及 dos 时间

Delphi 利用驱动最简单结束进程的方法

Delphi code无法回车换行

Delphi xe7使用本身的md5单元进行字符串加密

Delphi textfile utf8编码读写

Delphi xe android将域名转化为ip

Delphi四舍五入问题解决

Delphi twebbrowser也能响应回车键

Delphi 使用openjdk进行Delphi android开发

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



打赏

取消

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

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

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

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

评论

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