Print Page | Close Window

Change ID of an icon

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=8118
Printed Date: 18 June 2025 at 2:00am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Change ID of an icon
Posted By: indices
Subject: Change ID of an icon
Date 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.
 



Replies:
Posted By: SuperMario
Date Posted: 24 September 2007 at 3:26pm
Something like:

imgMgrCtlB.Icons.AddIcon imgMgrCtlA.Icons.GetImage(9, 16).Handle, 200, xtpImageNormal


Posted By: indices
Date 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?


Posted By: indices
Date 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.



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