Rich Text Boxes
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement