Autor Beitrag
Henry
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 619

WinXP Prof. SP3
D6 Prof.
BeitragVerfasst: Di 23.07.02 21:27 
Hallo,

Ich habe folgende Frage.

Gibt es die Möglichkeit, bei einem Text in einem TMemo oder TRichEdit, bestimmte Worte (die in einer Text oder Ini - Datei abgelegt sind) Hervporzuheben (farblich oder Fett)? So wie in der Delphi IDE. Wenn man dann noch verschiedene Farben festlegen könnte für Verschiedene Gruppen, wäre das super.

PS: Mit TRichEdit habe ich noch keine Erfahrung gesammelt, in dem Fall bitte etwas einfacher erklären (wenn möglich)

Danke für die Hilfe

_________________
mfg Henry
wwerner
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 185



BeitragVerfasst: Mi 24.07.02 06:56 
Das Prinzip ist hier beschrieben. Du must es noch anpassen

_________________
Gruß

Wolfgang

----------
zu hause ist es doch am schönsten
Henry Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 619

WinXP Prof. SP3
D6 Prof.
BeitragVerfasst: Mi 24.07.02 16:26 
Danke Dir erstmal für die Hilfe.
Bin gerade dabei das ganze zu analysieren :-)
Falls noch Fragen auftauchen, dann Poste ich nochmal.

_________________
mfg Henry
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 24.07.02 16:31 
Henry Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 619

WinXP Prof. SP3
D6 Prof.
BeitragVerfasst: Mi 24.07.02 20:00 
Ich hätte da noch ne andere Frage zu dem Thema.

1. Wie kann ich Im RichEdit ein Wort so suchen, das es wenn es
gefunden wurde gleich markiert ist (SelText)?
So wie mit
 Pos('wort', RichEdit1.Text)
Nur eben das das gesuchte Wort gleich markiert ist,
evt. sogar noch die Position des Wortendes herausgegeben wird
(zum weitersuchen)?

2. Wie kann ich wenn ich auf den Anfang der Zeile im RichEdit klicke
gleich die ganze Zeile Markieren?

Danke für die Hilfe

_________________
mfg Henry
Tpercon
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 60



BeitragVerfasst: Mi 24.07.02 22:24 
ausblenden Quelltext
1:
2:
3:
4:
i:=AnsiPos('wort', RichEdit1.Text)
RichEdit1.SelStart:=i;
RichEdit1.SelLength:=Length('wort');
RichEdit1.SelAttributes...

Ich würde wohl den Text aus dem RichEdit zuerst in nem String speichern und dann suchst du in dem String nach dem wort. Merkst die Position, passt den Text im RichEdit an und ersetzt das wort durch irgnewelche Zeichen. Dann kannst du mit AnsiPos weitersuchen....
Tpercon
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 60



BeitragVerfasst: Mi 24.07.02 22:31 
zu 2.: Den Anfang und das Ende der Zeile mußt du dir wohl selbst mit ner Schleife suchen und dann entsprechend SelStart, SelLength anwenden.