Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Double Use of Icons = Problems
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Double Use of Icons = Problems

 Post Reply Post Reply
Author
Message
finn View Drop Down
Groupie
Groupie
Avatar

Joined: 11 February 2005
Location: Germany
Status: Offline
Points: 60
Post Options Post Options   Thanks (0) Thanks(0)   Quote finn Quote  Post ReplyReply Direct Link To This Post Topic: Double Use of Icons = Problems
    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!

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: 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
[...]


Edited by SuperMario
Back to Top
finn View Drop Down
Groupie
Groupie
Avatar

Joined: 11 February 2005
Location: Germany
Status: Offline
Points: 60
Post Options Post Options   Thanks (0) Thanks(0)   Quote finn Quote  Post ReplyReply Direct Link To This Post Posted: 07 April 2005 at 8:29am

Thank you!

Yours,

Finn!

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.172 seconds.