Print Page | Close Window

TreeView Icons from ImageManager

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=1953
Printed Date: 14 July 2025 at 5:29am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: TreeView Icons from ImageManager
Posted By: ianp
Subject: TreeView Icons from ImageManager
Date Posted: 11 March 2005 at 1:02am

Is it possible for the MS Tree View to use the icons stored in an ImageManager icons collection?




Replies:
Posted By: Devin Dazzle
Date Posted: 11 March 2005 at 4:02am
No, this is not possible. The MS TreeView control can only use the MS ImageList control. When you assign an ImageList to a TreeView the hID is passed to indentify it. The ImageManager doesn't support this and does not comply with standard ImageList commands. So you have to use both.


Posted By: ianp
Date Posted: 11 March 2005 at 7:05am

I thought as much, though I was hoping that someone would have a cunning solution.

I like being able to load implementation specific icons into an application , but don't like loading them into two places (seems a waste). 

I like the inbuilt features the imagemanager has for loading icons (e.g. from an image 'strip') but don't like the fact that you can't then get indivdual icons out.



Posted By: Devin Dazzle
Date Posted: 11 March 2005 at 11:21am

I can't agree more. It is a complete waste to have to have two seperate image holding controls. Much of the time you might want to use the same icon in a toolbar and in a ListView/TreeView. Having the same icon contained in two different controls on the same form is a waste of resources.

You could have used a custom imagelist like the ImageManager if the ImageManager supported standard ImageList messages like ImageList_ExtractIcon or ImageList_Draw by subclassing the TreeView and capturing the TVM_SETIMAGELIST message aften assigning the custom imagelist using the TreeView_SetImageList macro. This will not work however as noted above.

The only solution I see is to subclass the treeview and paint the icons onto the treeview nodes yourself from the IconManager. I have not tried it but it should work. It just requires a bit of work.

______________
Best Regards Kim Pedersen
http://www.vbcodemagician.dk - Http://www.vbcodemagician.dk




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net