Danke beiden für die Hilfe!!
Ich habe es mit FindDialog1 realisiert. Kannte diese Komponente bis anhin gar nicht
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29:
| procedure TFormTestOutput.FindDialog1Find(Sender: TObject); var FoundAt: LongInt; StartPos, ToEnd: Integer; begin with RichEditTestingOutput do begin if SelLength <> 0 then
StartPos := SelStart + SelLength else
StartPos := 0;
ToEnd := Length(Text) - StartPos;
FoundAt := FindText(FindDialog1.FindText, StartPos, ToEnd, [stMatchCase]); if FoundAt <> -1 then begin SetFocus; SelStart := FoundAt; SelLength := Length(FindDialog1.FindText); end; end; end; |
Delphi-Quelltext
1: 2: 3: 4: 5:
| procedure TFormTestOutput.Button2Click(Sender: TObject); begin FindDialog1.Position := Point(RichEditTestingOutput.Left + RichEditTestingOutput.Width, RichEditTestingOutput.Top); FindDialog1.Execute; end; |
Damit funktionierts auch wunderbar

(Ist ja auch das Beispiel von der Delphi-Help

)
Grüsse