user3161924
user3161924

Reputation: 2315

Change MFC Menu to show all items instead of arrows?

Have an MFC application that uses one of the various styles available that has a CMFCMenuBar and toolbar. For the CMFCMenuBar it only shows the items used, otherwise the double-down arrows have to be clicked to see the rest of the items. How do I set it up so it's just all items all the time, without the arrows having to be used?

TIA!!

Upvotes: 1

Views: 403

Answers (3)

Barmak Shemirani
Barmak Shemirani

Reputation: 31609

It depends on how the menu is created and initialized. Look for the following code in CMainFrame class:

CList<UINT, UINT> lstBasicCommands;
lstBasicCommands.AddTail(ID_FILE_NEW);
lstBasicCommands.AddTail(ID_FILE_OPEN);
...
CMFCToolBar::SetBasicCommands(lstBasicCommands);

If you find it, then remove the call to SetBasicCommands

Or keep SetBasicCommands, and also add all the commands to lstBasicCommands

Upvotes: 3

Vlad Feinstein
Vlad Feinstein

Reputation: 11311

According to Microsoft, you should call

CMFCMenuBar::SetShowAllCommands(TRUE);

https://learn.microsoft.com/en-us/cpp/mfc/reference/cmfcmenubar-class?view=vs-2019#setshowallcommands

Upvotes: -1

Jovibor
Jovibor

Reputation: 789

Try using CMFCMenuBar::SetShowAllCommands method.

Upvotes: -1

Related Questions