Board index » cppbuilder » Colored text in TMemo or TRichEdit

Colored text in TMemo or TRichEdit

Hi,

I want to display many text lines in a window control and highlight some
of them.
By "highlighting", I mean to change the background color of the text.

Many debugging tools allow you to set breakpoints on lines.  They
indicate these
lines by highlighting the text.

My understanding is that a TListBox allows easy highlighting, but is not
suited
for large amounts of text.

I haven't found out how to highlight on a TMemo.

-- Thomas M.

 

Re:Colored text in TMemo or TRichEdit


Quote
"Thomas Matthews" <thomas.matth...@pb.com> wrote in message

news:3C1A3E7A.968067AE@pb.com...

Quote
> My understanding is that a TListBox allows easy highlighting, but is not
> suited for large amounts of text.

True, but a TListView with it's OwnerData property set to true is.

Quote
> I haven't found out how to highlight on a TMemo.

TMemo doesn't support colors like that.  TRichEdit supports only changing
the color of the text itself, not the background of characters.  TRichEdit
uses the RICHEDIT v1.0 control from the Win32 API.  RE 2.0 added character
background color support.  You can find more information about using RE 2.0
in Builder at http://home.att.net/~robertdunn/Yacs.html

Gambit

Other Threads