Question

When creating menus with submenus in Visual C++, I find that submenus begin as arrows that I must click to expand to see their contents. Is there a way (programmatically) to have the submenus pop-out already expanded (with no arrow to click)?

Here is an image of what I am talking about, before and after clicking aforementioned arrow: screen shot also here

Was it helpful?

Solution

it seems you are using the MFC Feature Pack. Go to CMainFrame::OnCreate(), you should be able to find something like

CMFCToolBar::SetBasicCommands(lstBasicCommands);

somewhere inside it.

lstBasicCommands 

is a list that holds all the menu items that are not be hidden initially. Simple populate it with the items you like.

You may also want to check out the samples code available here: C:\Program Files\Microsoft Visual Studio 9.0\Samples\1033

In case you do not call SetBasicCommands and do not create the list, the expand button is removed. This releases you from enhancing the list everytime you add a new command.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top