Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » How to remove a menu bar button? Collapse All
Subject Author Date
Offer Har Jun 6, 2010 - 10:17 PM

Dear Support,
I am trying to remove a menu from the main menu at run-time by removing its button like this:
    m_wndMenuBar.RemoveButton(0);
If I put this at the end of the OnCreate it does not work, however, if I put it in the message handling of CExtPopupMenuWnd::g_nMsgPrepareMenu it does.
How can I make the menu hidden at initialization?
Thanks,
Ron.

Technical Support Jun 7, 2010 - 6:44 AM

The CExtMenuControlBar menu bar component is an improved version of the CExtToolControlBar toolbar component. The menu bar buttons are the CExtBarButton toolbar buttons. You can use the CExtToolControlBar::RemoveButton() method for removing menu bar’s buttons. You should recompute menu bar parent frame’s layout to see changes (pMenuBar->GetParentFrame()->RecalcLayout()). If you implemented the CExtMenuControlBar::_UpdateMenuBar() virtual method for building menu bar’s buttons, then your method should know which buttons it should re-initialize.