Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Add icon in imagemanager
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Add icon in imagemanager

 Post Reply Post Reply
Author
Message
skluc View Drop Down
Newbie
Newbie
Avatar

Joined: 19 May 2004
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote skluc Quote  Post ReplyReply Direct Link To This Post Topic: Add icon in imagemanager
    Posted: 20 May 2004 at 7:46am

I want add I've a my resource of icons and i want use them on my toolbar.

How can I add icon in a imagemanager control via code?

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: 20 May 2004 at 7:51am
Images are added to the ImageManager via code using the CommandBars.AddIconHandle method.  Below is a sample of code to add an image in all three image states (normal, hot, disabled), or oyu ocan just add the "normal" icon and th e"hat" and "disabled should be created automatically.  You can pull the images from any source, I just used images in the imlToolbarIcons images list as an example.

    Debug.Print "ImageManager count before AddIconHandle: "; ImageManager.Icons.Count
   
    Dim hIcon As IPictureDisp
   
    'Change the icons for the ID_FILE_NEW control - will change image count assuming you
    'have not already added an image in the ImageManager control for ID_FILE_NEW
    Set hIcon = imlToolbarIcons.ListImages(1).ExtractIcon
    CommandBars.AddIconHandle hIcon, ID_FILE_NEW, xtpImageNormal, False
    Set hIcon = imlToolbarIcons.ListImages(2).ExtractIcon
    CommandBars.AddIconHandle hIcon, ID_FILE_NEW, xtpImageHot, False
    Set hIcon = imlToolbarIcons.ListImages(3).ExtractIcon
    CommandBars.AddIconHandle hIcon, ID_FILE_NEW, xtpImageDisabled, False
   
    Debug.Print "ImageManager count After AddIconHandle: "; ImageManager.Icons.Count


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