Changing the ImageID of a gadget item after creating it?

Just starting out? Need help? Post your questions and find answers here.
Jedive
User
User
Posts: 36
Joined: Sun Jun 29, 2003 11:56 am
Location: Spain

Changing the ImageID of a gadget item after creating it?

Post by Jedive »

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
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

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):

Code: Select all

    list = SendMessage_(GadgetID(1),#TCM_GETIMAGELIST,0,0)
    ImageList_ReplaceIcon_(list,1,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.
BERESHEIT
Post Reply