即我在程序里在文档窗口里写上一些文字后,用户不能修改,但可以选定和拷贝,以及拉动滚动条。
解决问题立即给分,决不食言!!!!!!

解决方案 »

  1.   

    加入wm_char的消息映射
    然后注掉这行void CTesteditView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) 
    {
    // TODO: Add your message handler code here and/or call default

       //CEditView::OnChar(nChar, nRepCnt, nFlags);<---注掉这行
    }
      

  2.   

    重载Create函数
    dwStyle|=ES_READONLY ;
      

  3.   

    BOOL CMyEditView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) 
    {
    // TODO: Add your specialized code here and/or call the base class
    dwStyle|=ES_READONLY ; return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
    }