Add icon in imagemanager |
Post Reply |
Author | |
skluc
Newbie Joined: 19 May 2004 Status: Offline Points: 7 |
Post Options
Thanks(0)
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? |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
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 |
|
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 |