Fred Stephens
Fred Stephens

Reputation: 9

How to change the sequence in the MDI Tab document menu?

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?

Upvotes: 0

Views: 374

Answers (2)

Raman D
Raman D

Reputation: 1

You can use following code for it:

CMFCTabCtrl &t = ((CMainFrame*)m_pMainWnd)->GetMDITabs();
t.MoveTab(<your tab number>, t.GetTabsNum()-1);

Upvotes: 0

xMRi
xMRi

Reputation: 15375

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.

Upvotes: 0

Related Questions