Help Center

CToolbar.AddButtonsmethod

Adds one or more buttons to a toolbar.

WindowsmethodCToolbar.incdocumented

Syntax

FUNCTION AddButtons (BYVAL hToolbar AS HWND, BYVAL nButtons AS DWORD, BYVAL lpButtons AS TBBUTTON PTR) AS BOOLEAN

Parameters

NameDescription
hToolbarHandle to the toolbar control.
nButtonsNumber of buttons to add.
lpButtonsPointer to an array of TBBUTTON structures that contain information about the buttons to add. There must be the same number of elements in the array as buttons specified by nButtons.

Return value

Returns TRUE if successful, or FALSE otherwise.

Description

Adds one or more buttons to a toolbar.

Remarks

If the toolbar was created using the CreateWindowExW function, you must send the TB_BUTTONSTRUCTSIZE message to the toolbar before sending TB_ADDBUTTONSW.

See TB_SETIMAGELIST for a discussion of how to assign bitmaps to toolbar buttons from one or more image lists.

Reference

  • Include file CToolbar.inc
  • Defined in AfxNova/CToolbar.inc:221
  • Documented in Windows/WIndows Controls/CToolbar Class.md
  • Topic: CToolbar Class