Hello, I want to highlicht some words in AdvRichEditor. The word are in a StringList.
After every Change of the Editor Content, it should update the highlight.
My Code so far in the procedure RichEditorChange:
var ASel : integer := ARichEditor.SelStart;
ARichEditor.OnChange := nil;
ARichEditor.UnHighlight;
for var AIndex: integer := 0 to Pred(AStringList.Count) do
begin
if ARichEditor.FindFirst(Format('?%s?', [AStringList[AIndex]])) then
begin
ARichEditor.SetSelectionHighlight;
while ARichEditor.FindNext do
ARichEditor.SetSelectionHighlight;
end;
end;
ARichEditor.ClearSelection;
ARichEditor.SetCaret(ASel);
ARichEditor.CaretToSelection;
ARichEditor.OnChange := RichEditorChange;
it is working, but for example TAB and Enter isn't working correctly anymore. What is wrong?
Best regards