CRichEditCtrl* pDetialEdit = new CRichEditCtrl();
pDetialEdit ->CreateEx(WS_EX_TRANSPARENT, WS_VISIBLE|WS_CHILD|WS_CLIPCHILDREN|ES_WANTRETURN|ES_MULTILINE|WS_VSCROLL|ES_READONLY,
CRect(0,0,100,100),this,pBtnItem->WndID);
pDetialEdit->SetWindowText(L"");
CHARFORMAT cf;
memset(&cf, 0, sizeof(CHARFORMAT));
pDetialEdit->GetDefaultCharFormat(cf);
cf.dwMask=CFM_COLOR|CFM_FACE|CFM_SIZE|CFM_BOLD;
cf.crTextColor = RGB(0,139,211);
cf.dwEffects = 0;//可以去掉粗体
cf.yHeight = 210;
wstring wsFace = L"宋体";
memset(cf.szFaceName, 0, LF_FACESIZE);
wmemcpy(cf.szFaceName, wsFace.c_str(), wsFace.length());
pDetialEdit ->SetDefaultCharFormat(cf);
CRichEditCtrl修改颜色,字体,粗体,字号
最新推荐文章于 2021-12-20 20:34:56 发布