1. 更新内容在最底部:
- CString strLogs;
- strLogs.Format(_T("%s"), _T("测试,测试"));
- m_viewprocess += strLogs;
- GetDlgItem(IDC_EDIT_LOG)->SetFont(&typeNameFont); //设置字体
- GetDlgItemText(IDC_EDIT_LOG, m_viewprocess);
- long len=m_viewprocess.GetLength();
- ((CEdit*)GetDlgItem(IDC_EDIT_LOG))->SetSel(len,len,true);
- ((CEdit*)GetDlgItem(IDC_EDIT_LOG))->ReplaceSel(strLogs);
2. 如果你不是使用的底部显示,有时候EDIT内容没有及时更新,总是在进行运行后才更新内容,可以调更新接口来实现及时更新:
- GetDlgItem(IDC_EDIT_LOG)->UpdateWindow();