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
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

CMFCRibbonCategory::AddPanel

Updated: October 2008

Creates a ribbon panel for the ribbon category.

CMFCRibbonPanel* AddPanel(
   LPCTSTR lpszPanelName,
   HICON hIcon = 0,
   CRuntimeClass* pRTI = NULL 
);

[in] lpszPanelName

Pointer to the name of the new ribbon panel.

[in] hIcon

Handle to the default icon for the new ribbon panel.

[in] pRTI

Pointer to runtime class information for a custom ribbon panel.

Pointer to the new ribbon panel if the method was successful; otherwise NULL if the panel was not created.

If you want to create a custom ribbon panel, you must specify its runtime class information in pRTI. The custom ribbon panel class must be derived from the CMFCRibbonPanel class.

The default icon for the ribbon panel is displayed when there is insufficient space to display the ribbon elements.

The following example demonstrates how to use the AddPanel method in the CMFCRibbonCategory class.

	// Create "Favorites" panel:
	strTemp.LoadString(IDS_RIBBON_FAVORITES);
	// CMFCRibbonCategory* pCategoryCustom
	CMFCRibbonPanel* pPanelFavorites = pCategoryCustom->AddPanel(strTemp, 
		m_PanelImages.ExtractIcon(15));

Header: afxribboncategory.h

Date

History

Reason

October 2008

Updated whole topic.

Information enhancement.

Community Additions

ADD
Show:
© 2015 Microsoft