共用方式為


CMFCToolBar::InsertButton

Inserts a button into the toolbar.

virtual int InsertButton(
   const CMFCToolBarButton& button,
   INT_PTR iInsertAt=-1 
);
virtual int InsertButton(
   CMFCToolBarButton* pButton,
   int iInsertAt=-1 
);

Parameters

  • [in] button
    Specifies the button to insert.

  • [in] iInsertAt
    Specifies the zero-based position to insert the button at.

Return Value

The position at which the button was inserted or -1 if an error occurs.

Remarks

If iInsertAt is -1, this method adds the button to the end of the list of toolbar buttons.

Call the CMFCToolBar::InsertSeparator method to insert a separator into the toolbar.

Requirements

Header: afxtoolbar.h

See Also

Reference

CMFCToolBar Class

Hierarchy Chart

CMFCToolBar::InsertSeparator