July 29th, 2004, 10:49 AM
Tree control item image changes when I click it
I have associated an image list with a tree control. It is loaded fine but when I click any of the item, the image associated with that time changes to the first image in image list. I don't know why would this happen? I am not even handling LButton click message. Any ideas why is this happening? thanks
July 29th, 2004, 10:57 AM
Because when you click an item, it will be selected, and the tree control will display it using the 'selected' image, if defined. When calling InsertItem(), you can pass the index for the normal image and for the selected image - I suspect you're passing 0 for the latter, causing the first image to be displayed whenever an item is selected.
Originally Posted by retry
Last edited by gstercken; July 29th, 2004 at 10:59 AM.
July 29th, 2004, 11:13 AM
Thanks gstercken, that was it!
but I was not expecting this since I am not using the TVIF_SELECTEDIMAGE mask, it should be disabled automatically! than even -1 is not working it displays empty white image or no image in other words.
I set the iSelectedImage to same as iImage so they both are same for each node.
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!