Professional UI Solutions
Site Map   /  Register


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 General Discussion » Disable Ribbonbar control Collapse All
Subject Author Date
Shailesh Nikam Dec 5, 2006 - 5:40 AM


I want to disable ribbon control on particular button click. How to do this?

Thanks in advance.

Technical Support Dec 5, 2006 - 1:31 PM

The MFC’s command updating mechanism is used in the ribbon bar absolutely like in toolbars and menus. So simply add the command updating handler for a button and invoke pCmdUI->Enable( FALSE ) to disable it either in the ribbon bar or menu. Please note that in the RibbonBar sample, all the commands are forcibly made enabled by returning TRUE value in the CMainFrame::OnCmdMsg() virtual method and not invoking parent class methods. If you are using the RibbonBar sample as a start up project, you should fix this issue. The CMainFrame::OnCmdMsg() virtual method typically invokes the main SDI view’s OnCmdMsg() method and the parent class method.