![]() |
Change ID of an icon |
Post Reply
|
| Author | |
indices
Groupie
Joined: 21 September 2007 Location: India Status: Offline Points: 44 |
Post Options
Thanks(0)
Quote Reply
Topic: Change ID of an iconPosted: 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.
|
|
![]() |
|
SuperMario
Senior Member
Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
Quote Reply
Posted: 24 September 2007 at 3:26pm |
|
Something like:
imgMgrCtlB.Icons.AddIcon imgMgrCtlA.Icons.GetImage(9, 16).Handle, 200, xtpImageNormal |
|
![]() |
|
indices
Groupie
Joined: 21 September 2007 Location: India Status: Offline Points: 44 |
Post Options
Thanks(0)
Quote Reply
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?
|
|
![]() |
|
indices
Groupie
Joined: 21 September 2007 Location: India Status: Offline Points: 44 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |