-
July 29th, 2004, 10:49 AM
#1
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
#2
Originally Posted by retry
Any ideas why is this happening? thanks
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.
Last edited by gstercken; July 29th, 2004 at 10:59 AM.
-
July 29th, 2004, 11:13 AM
#3
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.
thanks again!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|