CRichEditView编辑框,我的代码为什么不能改变文字颜色?

biancheng369 biancheng369 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
CString str;
CHARFORMAT cf;

str="1234567890";
str+="\r\n\r\n";
str+="0987654321";

GetRichEditCtrl().SetWindowText( str );

ZeroMemory(&cf, sizeof(CHARFORMAT));
cf.crTextColor = RGB(0, 255, 0);
GetRichEditCtrl().SetSel( 0,-1);
GetRichEditCtrl().SetSelectionCharFormat(cf);
...全文
评论 8
收藏 已收藏
分享
返回顶部
biancheng369
VC/MFC 16,550 成员 421,606 内容