Compartilhar via


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.

Syntax

class CMFCRibbonContextCaption : public CMFCRibbonButton  

Members

Public Methods

Name Description
CMFCRibbonContextCaption::CreateObject Used by the framework to create a dynamic instance of this class type.
CMFCRibbonContextCaption::GetColor Returns the color of the caption.
CMFCRibbonContextCaption::GetRightTabX
CMFCRibbonContextCaption::GetThisClass Used by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type.

Remarks

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.

Inheritance Hierarchy

CObject

CMFCRibbonBaseElement

CMFCRibbonButton

CMFCRibbonContextCaption

Requirements

Header: afxRibbonBar.h

CMFCRibbonContextCaption::GetColor

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.

CMFCRibbonContextCaption::GetRightTabX

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

See Also

Hierarchy Chart
Classes
CMFCRibbonButton Class
CMFCRibbonCategory Class
CMFCRibbonBar Class