Link to home
Start Free TrialLog in
Avatar of gangsterboss
gangsterboss

asked on

Memo highligher

i would like to be able to highlight the seleced text in a selected colour in a tmemo but i can not download components or install anything. it must also be highlighted when the file is opened again (save the fact that it has been highlighted). i must be able to high light more than the one part as well (similar to word). i do not want a reply if it is not possible because it is a waste of points and i only want code that will certainly work no guessing pls
Avatar of MrMidi
MrMidi
Flag of Netherlands image

Bad news is, you can't do that with a TMemo. Good news is, you can do it with a TRichEdit.
Avatar of gangsterboss
gangsterboss

ASKER

well how
First download Synedit package

1. www.sourceforge.net
2. Search "SynEdit" - there will be it
3. Download and install package (stable version, not new CVS)
4. There are demos how to do it - just search.
deti u been helpful before but read the question no downloads
but TMemo class not support highlighter in fragments of text - it is imposible.
well wot about trichedit then
Use OnDrawItem to Highlight the specied text
i need the code cos i aint to good at this
I not going to paste code here, because I don`t have one, but :

- try to find pos('sometext', RichEdit.Text);
- for loop if this pos is >0 then select this word
- RichEdit.SelAttributes.Color := clBlue; // set color of selected text as blue

ASKER CERTIFIED SOLUTION
Avatar of dopors
dopors

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
can u redo this code so it only does the richedit1.seltext instead of them all and comment each part cos i don't have a clue how this works and i am trying to learn