CRichEdit小记 - 11GX
首页 > CRichEdit小记

CRichEdit小记

-->

使用前要AfxInitRichEdit2();

修改背景颜色和字体颜色

    CRichEditCtrl* p=(CRichEditCtrl*)GetDlgItem(IDC_RICHEDIT21);CHARFORMAT2 cf;memset((char*)&cf,0,sizeof(cf));COLORREF color;color = RGB(0,255,0);cf.dwMask = CFM_COLOR;cf.crTextColor = color; //The text colorcf.cbSize = sizeof(CHARFORMAT2);p->SendMessage(EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf );p->SetBackgroundColor(FALSE,RGB(0,0,0));

 

转载于:https://www.cnblogs.com/cavehubiao/p/3553585.html

更多相关: