CMFCRibbonBar删除/隐藏QAT [英] CMFCRibbonBar remove/hide QAT

查看:415
本文介绍了CMFCRibbonBar删除/隐藏QAT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这就是事情 - 我们有一个包含功能区的C ++ MFC项目。我们设法隐藏了主按钮。现在我们想对QAT做同样的事情,因为它不会被使用 - 我们有自己的QAT类别。这可能吗?如何?

Here's the thing - we have a C++ MFC Project including a ribbon. We managed to hide the Main Button. Now we want to do the same with the QAT because it won't be used - we have our own QAT category. Is this possible and how?

推荐答案

解决了!我继承了CMFCRibbonBar。我添加了一个方法delQAT(),其中我调用m_QAToolbar.RemoveAll()。在CMyAppMainFrame :: OnCreate()中,我调用了这个新方法。

Solved it! I inherited CMFCRibbonBar. I added a method delQAT() in which i call m_QAToolbar.RemoveAll(). In CMyAppMainFrame::OnCreate() I call this new method.
class CRibbonBar : public CMFCRibbonBar
{
public:
   void delQAT()
   {
      m_QAToolbar.RemoveAll(); //m_QAToolbar is a protected member of CMFCRibbon
   }
}
class CMyAppMainFrame(...)
{
   //...
protected:
   CRibbon m_wndRibbonBar;
   //...
public:
   void OnCreate()
   {
      //...
      m_wndRibbonBar.delQAT();
      //...
   }
}





希望它能帮助遇到同样问题的其他人:)



Hope it'll help other people with the same problem :)


这篇关于CMFCRibbonBar删除/隐藏QAT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆