Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - TreeView Icons from ImageManager
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

TreeView Icons from ImageManager

 Post Reply Post Reply
Author
Message
ianp View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 19 December 2003
Location: United Kingdom
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote ianp Quote  Post ReplyReply Direct Link To This Post Topic: TreeView Icons from ImageManager
    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?

Back to Top
Devin Dazzle View Drop Down
Newbie
Newbie


Joined: 19 October 2004
Location: Denmark
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Devin Dazzle Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ianp View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 19 December 2003
Location: United Kingdom
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote ianp Quote  Post ReplyReply Direct Link To This Post 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.



Edited by ianp
Back to Top
Devin Dazzle View Drop Down
Newbie
Newbie


Joined: 19 October 2004
Location: Denmark
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Devin Dazzle Quote  Post ReplyReply Direct Link To This Post 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



Edited by Devin Dazzle
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.109 seconds.