CMFCMenuBar remove "Expand Submenu" Double Arrow (display recently and all available menu commands always)
>
Visual C++ MFC and ATL
Question
-
Hello,
I am trying to disable the feature "Expand Submenu" Double Arrow (VS2010 MFC MDI Application) to display always the recently and all available menu commands, so the user does not need to click the Double Arrow first to open the menu items. I added the following calls in the CMainFrame::OnCreate function:m_wndMenuBar.SetShowAllCommands( TRUE ); m_wndMenuBar.SetRecentlyUsedMenus( TRUE );But this doesn't help, because in thevoid CMFCMenuBar::OnChangeHot(int iHot)function the flag m_bShowAllCommands is reset to FALSE.I can derive my own menubar class from CMFCMenuBar and override the OnChangeHot function and set the flag to TRUE after calling the OnChange base class function (than it works as wanted), but is this the intended way?Thanks,
AndreasThursday, September 15, 2011 9:11 AM
Answers
-
You don't want the "intellegent menus" feature, some menu items are hidden, and you have to click to show the whole menu?
To disable this feature, go to CMainFrame::OnCreate. You will see some code like this:
Remove it.// enable menu personalization (most-recently used commands) // TODO: define your own basic commands, ensuring that each pulldown menu has at least one basic command. CList<UINT, UINT> lstBasicCommands; lstBasicCommands.AddTail(ID_FILE_NEW); lstBasicCommands.AddTail(ID_FILE_OPEN); ... lstBasicCommands.AddTail(ID_SORTING_GROUPBYTYPE); CMFCToolBar::SetBasicCommands(lstBasicCommands);
- Marked as answer byAndreas SchniertshauerMonday, September 19, 2011 7:33 AM
Friday, September 16, 2011 11:56 AM
All replies
-
You don't want the "intellegent menus" feature, some menu items are hidden, and you have to click to show the whole menu?
To disable this feature, go to CMainFrame::OnCreate. You will see some code like this:
Remove it.// enable menu personalization (most-recently used commands) // TODO: define your own basic commands, ensuring that each pulldown menu has at least one basic command. CList<UINT, UINT> lstBasicCommands; lstBasicCommands.AddTail(ID_FILE_NEW); lstBasicCommands.AddTail(ID_FILE_OPEN); ... lstBasicCommands.AddTail(ID_SORTING_GROUPBYTYPE); CMFCToolBar::SetBasicCommands(lstBasicCommands);
- Marked as answer byAndreas SchniertshauerMonday, September 19, 2011 7:33 AM
Friday, September 16, 2011 11:56 AM -
Yes, thanks, that's what I was looking for.
AndreasMonday, September 19, 2011 7:35 AM

本文介绍如何在Visual C++ MFC应用程序中禁用智能菜单功能,使所有菜单项始终可见,无需用户额外点击箭头。

3953

被折叠的 条评论
为什么被折叠?



