我在:PreCreateWindow(CREATESTRUCT& cs)
{
   cs.style |=(ES_MULTILINE|WS_HSCROLL|WS_VSCROLL );
   cs.style&=~(ES_AUTOHSCROLL|ES_AUTOVSCROLL);
   return CRichEditView::PreCreateWindow(cs);
}
不能还是自动换行.高手给个解决方案.

解决方案 »

  1.   

    你不要去掉ES_AUTOHSCROLL,ES_AUTOVSCROLL就行了
      

  2.   

    我直接在dialog上放CRichEditCtrl好象沒有問題.要不然demo给我看看.
    [email protected]
      

  3.   

    你的文本串里的换行付是\n 么?如果是这样的话,很可能需要改为\r\n才起作用,我就碰到过类似问题,应该是这样的
      

  4.   

    显示文本用可以用DrawText并设置nFormat参数为DT_WORDBREAK。
    CRichEditView::OnDraw(....)
    {
       ....
      CRect m_rect;
      GetClentRect(&m_rect);
      pDC->DrawText("XXXXXXXX...",&m_rect,DT_LEFT|DT_WORDBREAK);
      .....
    }
    这样如果字串长度超过了m_rect的范围,会自动换行。
      

  5.   

    用这个试试吧!
    GetRichEditCtrl().SetTargetDevice(NULL, 1);
      

  6.   

    m_nWordWrap = WrapNone;
    WrapChanged();
    ///////////////////////////////////////////////////////////////
    /*
    CRichEditView::m_nWordWrap
    ResIndicates the type of word wrap for this rich edit view. One of the following values: WrapNone   Indicates no automatic word wrapping.
    WrapToWindow   Indicates word wrapping based on the width of the window.
    WrapToTargetDevice   Indicates word wrapping based on the characteristics of the target device. 
    *////////////////////////////////////////////////////////////
      

  7.   

    呵呵,谢谢   romberg2002() 俺也知道了多谢多谢