Page 1 of 1

Changing the ImageID of a gadget item after creating it?

Posted: Sat May 10, 2008 1:00 pm
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?

Posted: Sat May 10, 2008 3:20 pm
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.