如何从 MFC 标题栏中删除关闭按钮

发布于 2024-07-19 15:09:36 字数 114 浏览 5 评论 0原文

有没有一种简单的方法可以从 MFC 功能包标题栏中删除关闭按钮?

(我不是指窗口标题,我指的是这些应用程序中客户区顶部出现的小信息栏 - 即:CMFCCaptionBar)

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

明天过后 2024-07-26 15:09:36

想出了一种方法...

class CNoCloseCaptionBar : public CMFCCaptionBar
{
public:
    CNoCloseCaptionBar()
    {
    }

    virtual void RecalcLayout()
    {
        __super::RecalcLayout();
        m_rectClose.SetRectEmpty();
    }

};

Figured out one way...

class CNoCloseCaptionBar : public CMFCCaptionBar
{
public:
    CNoCloseCaptionBar()
    {
    }

    virtual void RecalcLayout()
    {
        __super::RecalcLayout();
        m_rectClose.SetRectEmpty();
    }

};
终弃我 2024-07-26 15:09:36

删除位图对我有用。 请参阅 Visual C++ 2008 功能包中的 MSOffice2007Demo 示例。

在 CMainFrame:CreateMessageBar() 中注释掉以下行,

//m_wndMessageBar.SetBitmap(IDB_INFO, RGB(255, 255, 255), FALSE, CMFCCaptionBar::ALIGN_LEFT);

没有关闭按钮的标题栏
输入图片此处描述

Removing the bitmap worked for me. See the MSOffice2007Demo example in the Visual C++ 2008 Feature Pack.

Comment out the following line in CMainFrame:CreateMessageBar()

//m_wndMessageBar.SetBitmap(IDB_INFO, RGB(255, 255, 255), FALSE, CMFCCaptionBar::ALIGN_LEFT);

Caption Bar without close button
enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文