Search code examples
mfcmenubar

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!!


Solution

  • 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