SetDefaultCharFormat fails to set default color
- From: "VC Developer" <googlegroups@xxxxxxxxxxxxxxxxxxx>
- Date: 13 Dec 2005 14:57:31 -0800
I am using a CRichEditView and trying to display blue characters on a
black background while preserving any other colors in the RTF file.
I am using the following code:
CHARFORMAT2 cf2;
ZeroMemory(&cf2, sizeof(cf2));
cf2.cbSize = sizeof(cf2);
cf2.dwMask = CFM_COLOR;
cf2.crTextColor = RGB(0, 0, 0xff);
GetRichEditCtrl().SetDefaultCharFormat(cf2);
GetRichEditCtrl().SetBackgroundColor(FALSE, RGB(0, 0, 0));
If the RTF file has no colors other than the default color the function
works fine. If I select a part of the file and assign it a color, the
above code changes the background to black correctly. The sections of
the text set to different colors appear properly, but the default text
remains black.
Any ideas?
.
- Prev by Date: Re: SetCapture Problem
- Next by Date: Re: MFC future?
- Previous by thread: Comm Ports 10+
- Next by thread: A SDI HTMLView and App Activation Issues.....Kinda Stuck
- Index(es):