sam
It's not possible to have more than one background color using either a
TMemo or TRichedit control. However, you can use multiple font colors in a
TRichedit control. If you want to multiple background colors you'll have to
look at numerous third party components which do this.
"sam" <samue...@hotmail.com> wrote in message
news:3ea4baf8$1...@newsgroups.borland.com...
Yes. The easiest way is to manipulate the color (of the font) as you
add the text items. For this you do not use the Lines property, you use
SelStart, SelAttributes, and SelText.
// set caret to end of text
richedit.SelStart := richedit.GetTextLen;
richedit.selattributes.color := datacolor;
richedit.seltext := dateAndTime;
richedit.selattributes.color := messagecolor;
richedit.seltext : messagestring + #13#10;
...next line
As long as the SelLength is 0 (setting SelStart sets it to 0) any
change to SelAttributes will apply to the text you next add with
SelText. Each assignment to SelText puts the SelStart at the end of the
inserted text, so you can just add more without having to set SelStart
manually again. The #13#10 starts a new line.
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be