</pre><pre name="code" class="delphi">var
FoundPos:longint;
StartPos:integer;
str:string;
begin
with MemoArr[CurPage] do
begin
StartPos:=SelStart+SelLength;
str:=Copy(lines.Text,StartPos+1,Length(lines.Text)-StartPos+1);
FoundPos:=Pos(FindDialog1.FindText,str);
if Found>0 then
begin
FoundPos:=FoundPos+StartPos;
SetFocus;
SelStart:=FoundPos-1;
SelLength:=Length(FindDialog1.FindText);
end
else
Messagebox(0,PChar(Format('未找到"%s"!!!',[FindDialog1.FindText])),'提示',MB_OK);
end;
end;