Friday, May 6, 2011

How to remove the close button from an MFC caption bar

Is there an easy way to remove the close button from an MFC feature pack caption bar?

(I don't mean the window caption, I'm talking about the little information bar that can appear at the top of the client area in these apps - ie:CMFCCaptionBar)

Thanks

From stackoverflow
  • Figured out one way...

    class CNoCloseCaptionBar : public CMFCCaptionBar
    {
    public:
        CNoCloseCaptionBar()
        {
        }
    
        virtual void RecalcLayout()
        {
         __super::RecalcLayout();
         m_rectClose.SetRectEmpty();
        }
    
    };
    

0 comments:

Post a Comment