0

In the tabbed document view of the MFC feature pack the user can re-order the tabs by dragging and dropping and when there is a larger number of tabs in use you have a drop down list at the end.

The problem is that the menu item for windows with the drop list of the first 9 sessions and more windows, plus the drop down list at the end of the tabbed bar are in document load order.

Does anyone know of a example on how to change the Document order in the CDocManager class in order to stay in sync?

Cœur
  • 37,241
  • 25
  • 195
  • 267

2 Answers2

0

The relevant code can be found in CMFCTabCtrl::OnShowTabDocumentsMenu.

So reorder the internal array and you have what you need.

You have the source code so it shouldn't be a real big thing.

xMRi
  • 14,982
  • 3
  • 26
  • 59
0

You can use following code for it:

CMFCTabCtrl &t = ((CMainFrame*)m_pMainWnd)->GetMDITabs();
t.MoveTab(<your tab number>, t.GetTabsNum()-1);
Manjar
  • 3,159
  • 32
  • 44