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实现tedit控件的外观只有一条下划线

Delphi 修改快捷方式

Delphi2009 使用 png 图片

Delphi urlencode与urldecode

Delphi 获取随机字符串的方法 thash.getrandomstring

Delphi xe5实现android 安卓 左侧或者右侧菜单功能

Delphi xe将图标和图像添加为资源

Delphi datasnap 2009的简单使用

Delphi 去除 tstringlist 重复项

Delphi streamtohexstr

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



打赏

取消

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

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

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

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

评论

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