Changing the ImageID of a gadget item after creating it?
Changing the ImageID of a gadget item after creating it?
I have a panel with several tabs in my application. When I added the tabs to the panel, I could send them an ImageID to have them use an image together with the text on the tab. But after having created it, is it possible to change that image?
==Jedive==
MacBook Core Duo 2Ghz, 2GB, Intel GMA950, Leopard
Celeron M 1.5, 512MB, Intel 915GM, WinXP/DX9, Ubuntu
MacBook Core Duo 2Ghz, 2GB, Intel GMA950, Leopard
Celeron M 1.5, 512MB, Intel 915GM, WinXP/DX9, Ubuntu
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Not difficult at all. Say your panel gadget# is 1, it has 3 tabs and the second tab (which has a zero-based index of 1) currently has ImageID(0) set to it. You want to replace that with ImageID(1):
Note: Example is for using icons for the images, if you are using bitmaps you need to use ImageList_Replace instead of ImageList_ReplaceIcon.
Code: Select all
list = SendMessage_(GadgetID(1),#TCM_GETIMAGELIST,0,0)
ImageList_ReplaceIcon_(list,1,ImageID(1))
BERESHEIT