解决方案 »

  1.   

    void CYourView::OnInitialUpdate() 
    {
    CEditView::OnInitialUpdate();
    ModifyStyle(0,WS_CAPTION|WS_SYSMENU);
      

  2.   

    有了上面的设置:
    还需要自己改写(SetWindowText()因为它会写到客户区!)
    1.h
    class CMyView : public CEditView
    {
    protected:
    CMyView();           // protected constructor used by dynamic creation
    DECLARE_DYNCREATE(CMyView)
    CString m_Title;
    // Operations
    public:
    void SetTitle(LPCSTR Title);
    2.cpp
    void CMyView::SetTitle(LPCSTR Title)
    {
    m_Title=Title;
    }
    3. cpp
    void CMyView::OnNcPaint() 
    {
    // TODO: Add your message handler code here
    CEditView::OnNcPaint();// for painting messages
    CWindowDC dc(this);
    dc.SetBkMode(TRANSPARENT);
    dc.TextOut(30,2,m_Title,m_Title.GetLength());
    }
      

  3.   

    改风格也可以在:// !!!!!
    void CMyView::PreSubclassWindow() 
    {
    // TODO: Add your specialized code here and/or call the base class
    ModifyStyle(0, WS_CAPTION | WS_SYSMENU);
    //
    CEdit &ed=GetEditCtrl();
    ed.ModifyStyle(0, ES_WANTRETURN);// dwStyleDefault
    //
    CEditView::PreSubclassWindow();
    }