Print Page | Close Window

Add icon in imagemanager

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=763
Printed Date: 11 December 2024 at 11:35pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Add icon in imagemanager
Posted By: skluc
Subject: Add icon in imagemanager
Date 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?




Replies:
Posted By: SuperMario
Date 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





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