Export (0) Print
Expand All
MFC
Expand Minimize
This topic has not yet been rated - Rate this topic

CMFCRibbonBar::AddCategory

Creates and initializes a new ribbon category for the ribbon bar.

CMFCRibbonCategory* AddCategory(
   LPCTSTR lpszName,
   UINT uiSmallImagesResID,
   UINT uiLargeImagesResID,
   CSize sizeSmallImage = CSize(16, 16),
   CSize sizeLargeImage = CSize(32, 32),
   int nInsertAt = -1,
   CRuntimeClass* pRTI = NULL 
);
[in] lpszName

Name of the ribbon category.

[in] uiSmallImagesResID

Resource ID of the small image list for the ribbon category.

[in] uiLargeImagesResID

Resource ID of the large image list for the ribbon category.

[in] sizeSmallImage

Specifies the size of small images for the ribbon category.

[in] sizeLargeImage

Specifies the size of large images for the ribbon category.

[in] nInsertAt

Zero based index of the category location.

[in] pRTI

Pointer to a CMFCRibbonCategory Class run-time class to dynamically create a ribbon category at run-time.

A pointer to the new ribbon category if the method was successful; otherwise, NULL.

If the pRTI parameter is not NULL, the new ribbon category is created dynamically using the run-time class.

The following example demonstrates how to use the AddCategory method in the CMFCRibbonBar class.


	// Add "Home" category.
	// CMFCRibbonBar m_wndRibbonBar
	strTemp.LoadString(IDS_RIBBON_HOME);
	CMFCRibbonCategory* pCategoryHome = m_wndRibbonBar.AddCategory(strTemp, 
		IDB_WRITESMALL, IDB_WRITELARGE);


Header: afxribbonbar.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.