![]() |
"Change Button Image" icons |
Post Reply
|
| Author | ||
briansweat
Groupie
Joined: 04 December 2007 Status: Offline Points: 14 |
Post Options
Thanks(0)
Quote Reply
Topic: "Change Button Image" iconsPosted: 23 December 2008 at 6:17pm |
|
|
I'm having trouble setting the icons for the "Change Button Image" function in the Customize menu for an individual Command Bar Control.
![]() All icons are loaded into an ImageManager control at design-time. I've tried updating CommandBars.GlobalSettings.Icons and the Icons collections for the individual CommandBar. Does anyone know where this icon list is located? |
||
|
SuitePro 2008 version 12.1.0, VB 6.0 SP6
Brian Sweat Alterity, Inc. www.acctivate.com twitter.com/briansweat |
||
![]() |
||
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 24 December 2008 at 12:31am |
|
|
Hi,
Catch Customization event and set CustomizeOptions.CustomIcons property.
|
||
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
![]() |
||
briansweat
Groupie
Joined: 04 December 2007 Status: Offline Points: 14 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 December 2008 at 11:48am |
|
|
Thanks! I'm definitely on the right track now.
However, the custom icons are not being displayed. I have 32 icons in my ImageManager and I see 32 blank placeholders now. I have both 16x16 and 24x24 variants stored for icon in my ImageManager. ![]() I'm calling the RemoveAll method to clear the list first. Then, I'm calling Options.CustomIcons.AddIcons and passing a reference to the Icons collection of the ImageManager control...
I initially tried the following code, but receive an "Object doesn't support this property or method" error...
|
||
|
SuitePro 2008 version 12.1.0, VB 6.0 SP6
Brian Sweat Alterity, Inc. www.acctivate.com twitter.com/briansweat |
||
![]() |
||
SuperMario
Senior Member
Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 January 2009 at 12:29pm |
|
|
CommandBarsMDISample for VB6 has a sample on how to do this with some helpful comments.
|
||
![]() |
||
briansweat
Groupie
Joined: 04 December 2007 Status: Offline Points: 14 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 January 2009 at 12:39pm |
|
Thanks, I've looked at the method in the CommandBarsMDISample. The LoadBitmap function uses a bitmap in the file system. However, I'm using a CodeJock ImageManager control to store my icons. Of course, I could export the icons to a temp folder and use this method. At this point, I will probably just clear the list and remove this functionality :( |
||
|
SuitePro 2008 version 12.1.0, VB 6.0 SP6
Brian Sweat Alterity, Inc. www.acctivate.com twitter.com/briansweat |
||
![]() |
||
SuperMario
Senior Member
Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 January 2009 at 1:15pm |
|
|
A simple modification to the end of that method:
ImageManager1.Icons.LoadBitmap App.Path & "\Icons\CustomButtonIcons.bmp", ChangeButtonImageIconArray, xtpImageNormal Options.CustomIcons.AddIcons ImageManager1.Icons I simply added a imagemanager control to the MDI Form. I loaded the images from that same file into the imagemanager to save me time, but you can see it works from imagemanager as well. Maybe attach your project? Must be a problem with ids or something? |
||
![]() |
||
SuperMario
Senior Member
Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 January 2009 at 2:48pm |
|
|
Was that helpful? Should be no reason to disable the feature from your software
|
||
![]() |
||
briansweat
Groupie
Joined: 04 December 2007 Status: Offline Points: 14 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 January 2009 at 4:42pm |
|
|
Thank you so much for your help, but I'm still not getting anywhere
![]() Using an ImageManager in conjunction with LoadBitmap works for me. Icons saved in the ImageManager at design-time do not work. I've attached a variation of the MDISample illustrating the problem... uploads/20090105_163737_MDISample_Custo.zip I added the dropper.cur image (from sample directory) to the ImageManager1 at design-time. At run-time, it's displaying the icons from the bitmap successfully, followed by one blank button where the dropper image should be. I'm using the same Icon Id convention that's in my project (ie 10001). |
||
|
SuitePro 2008 version 12.1.0, VB 6.0 SP6
Brian Sweat Alterity, Inc. www.acctivate.com twitter.com/briansweat |
||
![]() |
||
SuperMario
Senior Member
Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 January 2009 at 8:35am |
|
|
It is just a problem with IDs. 1001 will never work unless you are trying to display 1001 images in the menu.
I simply changed the ID in your sample from 1001 to 32 in the imagemanager and it works fine. Here is why: When adding icons, the IconId must start with 1 and increment by 1 for each icon added. So the IconId will be numbered 1,2,3,4,...N. The suite provides 42 "built-in" icons that you can choose from and they are automatically displayed in the "Change Button Icon" popup menu if you do not remove them. If you do not remove the "built-in" icons that are provided with the toolkit then you should start your numbering at 43. If you start at 1 and you did not remove the "built-in" icons, then you will overwrite some of the "built-in" icons. So you would number your icons 43,44,45,...N. So you could even keep some of the "built-in" icons and overwrite the ones you don't need with your own custom icons. I changed the Id in your sample to 32 because we removed the original 42 icons first, then we added 31 of our own in the single bitmap. Hope this helps |
||
![]() |
||
briansweat
Groupie
Joined: 04 December 2007 Status: Offline Points: 14 |
Post Options
Thanks(0)
Quote Reply
Posted: 06 January 2009 at 12:46pm |
|
|
Ah, I would have never figured that out. Thanks so much!
Instead of using my existing (shared) ImageManager, I will create another ImageManager just for the CustomIcons. Thanks again! |
||
|
SuitePro 2008 version 12.1.0, VB 6.0 SP6
Brian Sweat Alterity, Inc. www.acctivate.com twitter.com/briansweat |
||
![]() |
||
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 |