共用方式為


CMFCRibbonPanel::Replace

Replaces one element with another based on their index value.

BOOL Replace(
    int nIndex,
    CMFCRibbonBaseElement* pElem
);

Parameters

  • [in] nIndex
    Specifies the zero-based index of the element to replace.

  • [in] [out] pElem
    A valid pointer to the element that replaces the original element.

Return Value

TRUE if the original ribbon element has been replaced successfully by the new ribbon element; FALSE if the ribbon element was not replaced or if there is no element at the specified index.

Remarks

To replace a ribbon element by command ID, call CMFCRibbonPanel::ReplaceByID.

Requirements

Header: afxRibbonPanel.h

See Also

Reference

CMFCRibbonPanel Class

Hierarchy Chart