Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
513 views
in Technique[技术] by (71.8m points)

MFC C++ - MDI tabbed views drop-list menu disappeared

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...