Partager via


CMFCRibbonMiniToolBar::SetCommands

Sets the list of commands to be displayed on the toolbar.

void SetCommands(
    CMFCRibbonBar* pRibbonBar,
    const CList<UINT,UINT>& lstCommands 
);

Parameters

  • [in] pRibbonBar
    The ribbon bar that the mini toolbar searches for the buttons to display.

  • [in] lstCommands
    The list of commands to be displayed on the mini toolbar. All ribbon categories are searched to find the associated buttons.

Remarks

Use this function to set the list of commands to be displayed in the mini toolbar.

Example

The following example demonstrates how to use the SetCommands method of the CMFCRibbonMiniToolBar class. This code snippet is part of the MS Office 2007 Demo sample.

    // CMFCRibbonMiniToolBar* pFloaty
    CList<UINT, UINT> lstCmds;

    lstCmds.AddTail(ID_FONT_FONT);
    lstCmds.AddTail(ID_FONT_FONTSIZE);
    lstCmds.AddTail(ID_FONT_GROWFONT);
    lstCmds.AddTail(ID_FONT_SHRINK);
    lstCmds.AddTail(ID_WRITE_CHANGESTYLES);
    lstCmds.AddTail(ID_EDIT_COPYFORMAT);
    lstCmds.AddTail(ID_FONT_BOLD);
    lstCmds.AddTail(ID_FONT_ITALIC);
    lstCmds.AddTail(ID_PARA_CENTER);
    lstCmds.AddTail(ID_FONT_TEXTHIGHLIGHT);
    lstCmds.AddTail(ID_FONT_COLOR);
    lstCmds.AddTail(ID_PARA_DECREASEINDENT);
    lstCmds.AddTail(ID_PARA_INCREASEINDENT);
    lstCmds.AddTail(ID_PARA_BULLETS);

    pFloaty->SetCommands(((CMainFrame*) GetTopLevelFrame())->GetRibbonBar(), lstCmds);

Requirements

Header: afxRibbonMiniToolBar.h

See Also

Reference

CMFCRibbonMiniToolBar Class

Hierarchy Chart