Код:
var
i: Integer;
FindWord: string;
pos: Integer;
begin
RichEdit1.Lines.BeginUpdate;
try
for i := 0 to RichEdit2.Lines.Count - 1 do
begin
FindWord := RichEdit2.Lines[i];
pos := 0;
while True do
begin
pos := RichEdit1.FindText(FindWord, pos, Length(RichEdit1.Text) - pos, []);
if pos < 0 then Break;
RichEdit1.SelStart := pos;
RichEdit1.SelLength := Length(FindWord);
RichEdit1.SelText := RichEdit3.Lines[i];
Inc(pos);
end;
end;
finally
RichEdit1.Lines.EndUpdate;
end;
end;
Вот тот самый код по ричу. Т.е в данном случае можно заменить все ричы на листбокс, и вместо
Код:
pos := RichEdit1.FindText(FindWord, pos, Length(RichEdit1.Text) - pos, []);
Поставить
Код:
pos := listbox1.items.index0f(параметры) - pos, []);
заранее извиняюсь за то что туплю