Export (0) Print
Expand All
Expand Minimize

CMFCRibbonBar::AddMainCategory

Creates a new main ribbon category for the ribbon bar.

CMFCRibbonMainPanel* AddMainCategory(
   LPCTSTR lpszName,
   UINT uiSmallImagesResID,
   UINT uiLargeImagesResID,
   CSize sizeSmallImage = CSize(16, 16),
   CSize sizeLargeImage = CSize(32, 32) 
);

[in] lpszName

Name of the main ribbon category.

[in] uiSmallImagesResID

Resource ID of small images.

[in] uiLargeImagesResID

Resource ID of large images.

[in] sizeSmallImage

The size of small images.

[in] sizeLargeImage

The size of large images.

Pointer to the new main ribbon category if the method was successful; otherwise, NULL.

If a main ribbon category already exists, it is deleted.

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

	// m_wndRibbonBar is declared as a protected member variable  
	// CMFCRibbonBar m_wndRibbonBar. 
	// strTemp is a CString variable.
	strTemp.LoadString(IDS_RIBBON_FILE);
	CMFCRibbonMainPanel* pMainPanel = m_wndRibbonBar.AddMainCategory(strTemp, 
		IDB_FILESMALL, IDB_FILELARGE);

Header: afxribbonbar.h

Show:
© 2014 Microsoft