hello, im learning unicode richedit control like this
Code:
CString data(_T("Data"));
s_richedit.Append(data); // s_richedit is CString control of rich edit
CHARFORMAT2 cf;
::memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.crTextColor = RGB(0,0,255);
cf.dwMask = CFM_COLOR ;
ctl_richedit.SetSel(ctl_richedit.GetTextLength(), ctl_richedit.GetTextLength() + data.GetLength()); //ctl_richedit is CRichEditCtrl of richedit
::SendMessage(ctl_richedit.GetSafeHwnd(), EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &cf);
ctl_richedit.ReplaceSel(data);
actually that works, but when the size of richedit get around 256, the color back to BLACK
what's going on here? i had tried to replace
Code:
ctl_richedit.SetSel(ctl_richedit.GetTextLength(), ctl_richedit.GetTextLength() + data.GetLength()); //ctl_richedit is CRichEditCtrl of richedit
with
ctl_richedit.SetSel(ctl_richedit.GetTextLength(), 500); //ctl_richedit is CRichEditCtrl of richedit
nothing change
thx for any opinion and help ^^