BCGControlBar Pro for MFC
virtual BOOL CBCGPToolBar::RemoveButton ( int  iIndex)
virtual

Removes a button from a toolbar.

Returns
Nonzero if successful; it is 0 if the specified by iIndex index is invalid or you're trying to remove the "Customize" button (see EnableCustomizeButton()).

This function removes a button specified by the iIndex parameter. The RemoveButton function automatically checks for various invalid situations and corrects them:

  • if the removed button was selected ("hot") it calls OnChangeHot (-1).
  • if a separator becomes the last button, it is deleted as well.
  • it doesn't leave two separators together.

When the button has been removed it rebuilds the accelerator table accordingly.

Parameters
iIndexSpecifies the index of a button to remove.