BOOL CLkwView::OnEraseBkgnd(CDC* pDC) 
{
// TODO: Add your message handler code here and/or call default
GetRichEditCtrl().SetBackgroundColor(FALSE, RGB(255,193,50));
return CRichEditView::OnEraseBkgnd(pDC);
}

解决方案 »

  1.   

    派生一个类了:
    class CTempView : public CRichEditView
    {
    private:
    COLORREF m_clrText;
    COLORREF m_clrBkgnd;
    CBrush m_brBkgnd;
    }
    CTempView::CTempView()
    {
    m_clrText = RGB( 0, 0, 0 );
    m_clrBkgnd = RGB( 255, 255, 0 );
    m_brBkgnd.CreateSolidBrush( m_clrBkgnd );
    }
    HBRUSH CTempView::CtlColor(CDC* pDC, UINT nCtlColor) 
    {
    pDC->SetTextColor( m_clrText );    // text
    pDC->SetBkColor( m_clrBkgnd );    // text bkgnd
    return m_brBkgnd;                // ctl bkgnd
    }