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
Bad news is, you can't do that with a TMemo. Good news is, you can do it with a TRichEdit.
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.
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.
ASKER
deti u been helpful before but read the question no downloads
but TMemo class not support highlighter in fragments of text - it is imposible.
ASKER
well wot about trichedit then
Use OnDrawItem to Highlight the specied text
ASKER
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.Col or := clBlue; // set color of selected text as blue
- try to find pos('sometext', RichEdit.Text);
- for loop if this pos is >0 then select this word
- RichEdit.SelAttributes.Col
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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