Nathan Fig
Nathan Fig

Reputation: 15119

How to Remove Visual C++ "Expand Menu" Arrow?

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

Upvotes: 4

Views: 3240

Answers (1)

t.g.
t.g.

Reputation: 1749

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.

Upvotes: 7

Related Questions