0
votes

I am learning MFC C++ and found a problem with MDI tabbed menu. Even my application is a MDI style but I can not see document list drop-list menu. Please help me! Thanks in advance!

I have tried to change values in CMDITabInfo but nothing happens...

CMDITabInfo mdiTabParams;
mdiTabParams.m_style = CMFCTabCtrl::STYLE_3D_ONENOTE; // other styles available...
mdiTabParams.m_bActiveTabCloseButton = TRUE;      // set to FALSE to place close button at right of tab area
mdiTabParams.m_bTabIcons = FALSE;    // set to TRUE to enable document icons on MDI taba
mdiTabParams.m_bAutoColor = TRUE;    // set to FALSE to disable auto-coloring of MDI tabs
mdiTabParams.m_bDocumentMenu = TRUE; // enable the document menu at the right edge of the tab area
EnableMDITabbedGroups(TRUE, mdiTabParams);

enter image description here

1
The image you show is the drop-down window menu. Open more child windows and their names will appear in the list.Adrian Mole
Dear Adrian Mole, Thank you very much for your reply! I have opened 10 tabs but the menu still didnt appear. It is so strange that I have changed CMDITabInfo values but nothing update even m_style...JustBeginer
Have you tried to use CMFCTabCtrl::EnableTabDocumentsMenu ? docs.microsoft.com/en-us/cpp/mfc/reference/…flaviu2

1 Answers

0
votes

On ending of your CMainFrame::OnCreate you can write:

EnableMDITabs(TRUE, TRUE, CMFCBaseTabCtrl::LOCATION_TOP, TRUE, 
    CMFCTabCtrl::STYLE_3D_SCROLLED, FALSE, 
    FALSE);

CMFCTabCtrl& MFCTabCtrl = GetMDITabs();
MFCTabCtrl.EnableTabSwap(TRUE);
MFCTabCtrl.EnableTabDocumentsMenu(TRUE);
MFCTabCtrl.EnableAutoColor(FALSE);

This ensure you what you need.