Export (0) Print
Expand All
Expand Minimize


Changes the bitmap for a button in the current toolbar control.

BOOL ChangeBitmap(
     int idButton, 
     int iBitmap



[in] idButton

Command identifier of the button that is to receive a new bitmap.

[in] iBitmap

Zero-based index of an image in the current toolbar control's image list.

true if this method is successful; otherwise, false.

If this method is successful, the system displays the specified image in the specified button.

This method sends the TB_CHANGEBITMAP message, which is described in the Windows SDK.

Header: afxcmn.h

The following code example changes the bitmap for the File Save button to the bitmap for the About button.

		// Change the bitmap for the File Save button, whose 
		// command ID is ID_FILE_SAVE, to the bitmap for the 
		// About button, whose index is 7. 
		CToolBarCtrl& m_toolBarCtrl = m_wndToolBar.GetToolBarCtrl();
		BOOL bRet = m_toolBarCtrl.ChangeBitmap( ID_FILE_SAVE, 7 );

Community Additions

© 2015 Microsoft