Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize


Defines the order in which the ribbon panels of the ribbon category collapse.

void SetCollapseOrder(
   const CArray<int,int>& arCollapseOrder 

[in] arCollapseOrder

Specifies the collapse order. The array contains zero-based indexes of ribbon panels.

The library defines the collapse order. However, you can customize this behavior by providing the category with the list of indexes that specifies the collapse order.

When the category detects that it has to collapse a ribbon panel, it looks for the next element in the specified list. If the list is empty, or you have not specified enough elements, then the category uses the internal algorithm.

For example, the category has three ribbon panels and can be collapsed several times until all panels are in the fully collapsed state. You can set the following collapse order: 0, 0, 2, 2. In this case, the category will collapse the panel 0 two times, the panel 2 two times. The panel that has the index of 1 remains uncollapsed.

The following example demonstrates how to use the SetCollapseOrder method in the CMFCRibbonCategory class. The example shows how to construct an array for the collapse order, and how to set the collapse order to the ribbon category.

	CArray<int,int> arCollapseOrder;
	// CMFCRibbonCategory* pCategoryHome

Header: afxribboncategory.h

© 2015 Microsoft