滚动条滚动到最下方: char *pMsg=(char *)lParam; int len = m_RichEditCtrl.GetWindowTextLength(); m_RichEditCtrl.SetSel(len,len); m_RichEditCtrl.ReplaceSel(pMsg); m_RichEditCtrl.ReplaceSel("/n"); m_RichEditCtrl.PostMessage(WM_VSCROLL, SB_BOTTOM, 0);//滚动条滚动到最下方 显示单行edit的最后那部分文字: m_edit.SetFocus(); m_edit.SetSel(m_edit.GetTextLength()-1,m_edit.GetTextLength()); CString strSelText = m_edit.GetSelText(); m_edit.ReplaceSel(strSelText);