CToolbar.SetButtonInfomethod
Sets the information for an existing button in a toolbar.
Syntax
FUNCTION SetButtonInfo (BYVAL hToolbar AS HWND, BYVAL iID AS LONG, BYVAL ptbbi AS TBBUTTONINFOW PTR) AS LONG
FUNCTION SetButtonInfo (BYVAL hToolbar AS HWND, BYVAL iID AS LONG, BYREF tbbi AS TBBUTTONINFOW) AS LONG
Parameters
| Name | Description | |
|---|---|---|
hToolbar | Handle to the toolbar control. | |
iID | Button identifier. | |
ptbbi | Pointer to a TBBUTTONINFO structure that contains the new button information. The cbSize and dwMask members of this structure must be filled in prior to sending this message. | |
tbbi | A TBBUTTONINFO structure that contains the new button information. The cbSize and dwMask members of this structure must be filled in prior to sending this message. |
Return value
Returns nonzero if successful, or zero otherwise.
Description
Sets the information for an existing button in a toolbar.
Remarks
Text is commonly assigned to buttons when they are added to a toolbar by specifying the index of a string in the toolbar's string pool. If you use a TB_SETBUTTONINFO to assign new text to a button, it will permanently override the text from the string pool. You can change the text by calling TB_SETBUTTONINFO again, but you cannot reassign the string from the string pool
Reference
- Include file
CToolbar.inc - Defined in AfxNova/CToolbar.inc:1040
- Documented in Windows/WIndows Controls/CToolbar Class.md
- Topic: CToolbar Class