Поделиться через


CToolBarCtrl::AddBitmap

Adds one or more button images to the list of button images stored in the toolbar control.

int AddBitmap(
   int nNumButtons,
   UINT nBitmapID 
);
int AddBitmap(
   int nNumButtons,
   CBitmap* pBitmap 
);

Параметры

  • nNumButtons
    Number of button images in the bitmap.

  • nBitmapID
    Resource identifier of the bitmap that contains the button image or images to add.

  • pBitmap
    Pointer to the CBitmap object that contains the button image or images to add.

Возвращаемое значение

Zero-based index of the first new image if successful; otherwise – 1.

Заметки

You can use the Windows API CreateMappedBitmap to map colors before adding the bitmap to the toolbar. If you pass a pointer to a CBitMap object, you must ensure that the bitmap is not destroyed until after the toolbar is destroyed.

Требования

Header: afxcmn.h

См. также

Основные понятия

CToolBarCtrl Class

CToolBarCtrl Members

Hierarchy Chart

CToolBarCtrl::AddButtons

CToolBarCtrl::InsertButton

CToolBarCtrl::AddString

CToolBarCtrl::AddStrings