Print Page | Close Window

Double Use of Icons = Problems

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=2089
Printed Date: 17 November 2024 at 4:03pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Double Use of Icons = Problems
Posted By: finn
Subject: Double Use of Icons = Problems
Date Posted: 07 April 2005 at 8:14am

Hello! I load my Icons into an Array (like in the ShortCutbarReport Sample). That works very fine! But when I use an twice, then one of them won't be shown. Here is an example:

[...]
toolbarIconArray(25) = ID_WEB_SEARCH
toolbarIconArray(25) = ID_OUTLOOK_TODAY
[...]

ImageManager.Icons.LoadBitmap App.Path & "\Icons\imagelist.bmp", toolbarIconArray, xtpImageNormal

When I do it this way around, then the Icon for the Button with the ID "ID_OUTLOOK_TODAY" isn't visible. There only stands text.

I don't want to load the icons into two arrays. Is there a way for double use of one icon?

Yours,

Finn!

PS.: Sorry for my bad English, but I'm from Germany!




Replies:
Posted By: SuperMario
Date Posted: 07 April 2005 at 8:23am
You can't assign multiple IDs to the sample element in the array, in this case, you would always see the second image.  To fix this, set the IconId property of the controls in your toolbar to point to the same image (only added once) in your image manager.

[...]
toolbarIconArray(25) = ID_WEB_IMAGE
[...]

[...]
    Set ControlEdit = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&Edit", -1, False)
    With ControlEdit.CommandBar.Controls
        Set Control = .Add(xtpControlButton, ID_EDIT_UNDO, "Undo", -1, False)      
        Control.IconId = ID_WEB_IMAGE
        Set Control = .Add(xtpControlButton, ID_EDIT_CUT, "Cu&t", -1, False)
        Control.IconId = ID_WEB_IMAGE
    End With
[...]


Posted By: finn
Date Posted: 07 April 2005 at 8:29am

Thank you!

Yours,

Finn!




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