CToolbar.InsertButtonmethod
Inserts a button in a toolbar.
Syntax
FUNCTION InsertButton (BYVAL hToolbar AS HWND, BYVAL idxButton AS LONG, BYVAL pButton AS TBBUTTON PTR) AS BOOLEAN
FUNCTION InsertButton (BYVAL hToolbar AS HWND, BYVAL idxButton AS LONG, BYREF Button AS TBBUTTON) AS BOOLEAN
FUNCTION InsertButton (BYVAL hToolbar AS HWND, BYVAL idxButton AS LONG, BYVAL idxBitmap AS LONG, BYVAL idCommand AS LONG, BYVAL fsState AS UBYTE = 0, BYVAL fsStyle AS UBYTE = 0, BYVAL dwData AS DWORD_PTR = 0, BYVAL pwszText AS WSTRING PTR = NULL) AS BOOLEAN
Parameters
| Name | Description | |
|---|---|---|
hToolbar | Handle to the toolbar control. | |
idxButton | Zero-based index of a button. The message inserts the new button to the left of this button. | |
pButton | Pointer to a TBBUTTON structure containing information about the button to insert. | |
Button | A TBBUTTON structure containing information about the button to insert. | |
idxBitmap | Zero-based index of the button image. Set this member to I_IMAGECALLBACK, and the toolbar will send the TBN_GETDISPINFO notification code to retrieve the image index when it is needed. | |
idCommand | Command identifier associated with the button. This identifier is used in a WM_COMMAND message when the button is chosen. | |
fsState | Button state flags. This member can be a combination of the values listed in Toolbar Button States. | |
fsStyle | Button style. This member can be a combination of the button style values listed in Toolbar Control and Button Styles. | |
dwData | Application-defined value. | |
pwszText | Pointer to a string buffer that contains text for the button. |
Description
Inserts a button in a toolbar.
Reference
- Include file
CToolbar.inc - Defined in AfxNova/CToolbar.inc:267
- Documented in Windows/WIndows Controls/CToolbar Class.md
- Topic: CToolbar Class