Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Change ID of an icon
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Change ID of an icon

 Post Reply Post Reply
Author
Message
indices View Drop Down
Groupie
Groupie


Joined: 21 September 2007
Location: India
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote indices Quote  Post ReplyReply Direct Link To This Post Topic: Change ID of an icon
    Posted: 21 September 2007 at 12:31pm
I have 2 image manager controls (imgMgrCtlA and imgMgrCtlB).
imgMgrCtlA containis 10 icons with IDs 1 to 10.
 
I wish to copy the icon with ID 9 from imgMgrCtlA to imgMgrCtlB. The copied icon should now have the ID 200 in imgMgrCtlB.
 
Is this possible programmatically at runtime?
 
Thank you.
 
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 24 September 2007 at 3:26pm
Something like:

imgMgrCtlB.Icons.AddIcon imgMgrCtlA.Icons.GetImage(9, 16).Handle, 200, xtpImageNormal
Back to Top
indices View Drop Down
Groupie
Groupie


Joined: 21 September 2007
Location: India
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote indices Quote  Post ReplyReply Direct Link To This Post Posted: 25 September 2007 at 8:09pm
Thank you that worked. However I am seeing an issue. It works in some cases and in some cases it doesn't. I don't get an error but on occasions imgMgrCtlA.Icons.GetImage(9, 16).Handle returns a negative value is that expected?
Let me explain my requirement in detail.
imgMgrCtlA contains icons for a gallery.
imgMgrCtlB contains one icon which is used to display a split button.
 
when a selection is made in the gallery, I want to disply the selected icon on the splitbutton. I figured that if the icon associated with the selected item from the gallery was copied over with matching id of the splitbutton icon it would update itself. It works sometimes an on others it does not. Any ideas?
Back to Top
indices View Drop Down
Groupie
Groupie


Joined: 21 September 2007
Location: India
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote indices Quote  Post ReplyReply Direct Link To This Post Posted: 25 September 2007 at 10:33pm
Nevermind. I figured out that I can use IconID instead to achieve the same. Thanks for your help.
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.031 seconds.