Advertisement

Rich Text Boxes

Started by May 06, 2001 07:43 PM
1 comment, last by edgecrusher 23 years, 9 months ago
Does anyone know the syntax for changing text color in a richtextbox? I thought it would be the same as html... but I cannot find anything on it. Thanks.
You can change all the text in the control to a single color if you are using SetWindowText to put the text in there.

In MFC it is in CRichEditCtrl::SetDefaultCharFormat.

If you want to color individual words, etc then you have to use the CRichEditCtrl::StreamIn function (or equivalent win32 control message EM_STREAMIN) and use RTF-formatted text.

Definitely a tricky business, but it does work fine when you get it all set up.

DSutherland


Advertisement
try the CodeMax control from WinMain. It does stuff like syntax colouring for you, along with tons of other stuff. And its free (i think)!

This topic is closed to new replies.

Advertisement