CToolbar.SetPressedImageListmethod
Sets the image list that the toolbar uses to display buttons that are in a pressed state.
Syntax
FUNCTION SetPressedImageList (BYVAL hToolbar AS HWND, BYVAL iImageID AS DWORD, BYVAL himlNew AS HIMAGELIST) AS HIMAGELIST
Parameters
| Name | Description | |
|---|---|---|
hToolbar | Handle to the toolbar control. | |
iImageID | The index of the image list. If you use only one image list, set this parameter to zero. | |
himlNew | Handle to the image list to set. If this parameter is NULL, no images are displayed in the buttons. |
Return value
Returns the handle to the image list previously used to display buttons in their pressed state, or NULL if no such image list was previously set.
Description
Sets the image list that the toolbar uses to display buttons that are in a pressed state.
Remarks
Your application is responsible for freeing the image list after the toolbar is destroyed.
The TB_SETPRESSEDIMAGELIST message cannot be combined with TB_ADDBITMAP. It also cannot be used with toolbars created with CreateToolbarEx, which calls TB_ADDBITMAP internally. When you create a toolbar with CreateToolbarEx or use TB_ADDBITMAP to add images, the toolbar manages the image list internally. Attempting to modify it with TB_SETPRESSEDIMAGELIST has unpredictable consequences.
Reference
- Include file
CToolbar.inc - Defined in AfxNova/CToolbar.inc:1125
- Documented in Windows/WIndows Controls/CToolbar Class.md
- Topic: CToolbar Class