CMFCRibbonContextCaption Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CMFCRibbonContextCaption Class.

Implements a colored caption that appears at the top of a ribbon category or a context category.

class CMFCRibbonContextCaption : public CMFCRibbonButton  

Public Methods

NameDescription
CMFCRibbonContextCaption::CreateObjectUsed by the framework to create a dynamic instance of this class type.
CMFCRibbonContextCaption::GetColorReturns the color of the caption.
CMFCRibbonContextCaption::GetRightTabX
CMFCRibbonContextCaption::GetThisClassUsed by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type.

This class cannot be directly instantiated. The CMFCRibbonBar Class class uses this class internally to add color to ribbon categories.

To set the color for ribbon categories, call CMFCRibbonCategory::SetTabColor. To set the color for context categories, call CMFCRibbonBar::AddContextCategory.

CObject

CMFCRibbonBaseElement

CMFCRibbonButton

CMFCRibbonContextCaption

Header: afxRibbonBar.h

Returns the background color of the caption.

AFX_RibbonCategoryColor GetColor() const;  

Return Value

The returned value can be one of the following enumerated values:

  • AFX_CategoryColor_None

  • AFX_CategoryColor_Red

  • AFX_CategoryColor_Orange

  • AFX_CategoryColor_Yellow

  • AFX_CategoryColor_Green

  • AFX_CategoryColor_Blue

  • AFX_CategoryColor_Indigo

  • AFX_CategoryColor_Violet

Remarks

The color of the caption can be set by calling CMFCRibbonCategory::SetTabColor or CMFCRibbonBar::AddContextCategory.

Retrieves the position of the right-hand edge of the category’s ribbon tab.

int GetRightTabX() const;  

Return Value

Returns the right-hand X-value of the enclosing rectangle of the CMFCRibbonCategory object’s ribbon tab, or a value of -1 if the tab is truncated.

Remarks

Hierarchy Chart
Classes
CMFCRibbonButton Class
CMFCRibbonCategory Class
CMFCRibbonBar Class

Show: