MFC RichEdit 实现多行显示,并自动滚屏
CRichEditCtrl m_rheditOutputText;
m_rheditOutputText.PostMessage(WM_VSCROLL, SB_BOTTOM, 0);
CString curdata = str + "\r\n";
CHARFORMAT cf;
ZeroMemory(&cf, sizeof(CHARFORMAT));
cf.cbSize = sizeof(CHARFORMAT);
cf.dwMask = CFM_BOLD | CFM_COLOR | CFM_FACE |
CFM_ITALIC | CFM_SIZE | CFM_UNDERLINE;
cf.yHeight = 6 * 6;//文字高度
m_rheditOutputText.SetReadOnly(TRUE);
cf.crTextColor = color; //文字颜色
m_rheditOutputText.SetSelectionCharFormat(cf);
m_rheditOutputText.SetSel(-1, -1);
m_rheditOutputText.ReplaceSel(curdata);
版权声明:本文为CSDN博主「ge646834690」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/ge646834690/article/details/113609501