How to change toolbar icon |
Post Reply |
Author | |
rdtcgriffin
Newbie Joined: 18 March 2004 Status: Offline Points: 19 |
Post Options
Thanks(0)
Posted: 20 April 2004 at 11:18pm |
I need to change an icon in the toolbar whenever a Flag within the program is changed. How do I do this? Thanks |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Change the IconId. For example, say you have set the "Tag" value
of your image in an image list to 100, 101, and 102. The you
would have the following code:
'Declare constants Const ID_FILE_SAVE = 100 Const ID_FILE_SAVED = 101 Const ID_FILE_NEW = 102 'Add a toolbar and a control to the toolbar Dim Control As CommandBarControl Dim ToolBar As CommandBar Set ToolBar = CommandBars.Add("Standard", xtpBarTop) With ToolBar.Controls Set Control = .Add(xtpControlButton, ID_FILE_SAVE, "Save", -1, False) End With 'Find the control in the toolbar and change the IconId Set Control = CommandBar.FindControl(, ID_FILE_SAVE,,True) If Not Control Is Nothing Then Control.IconId = IF_FILE_SAVED EndIf Edited by SuperMario |
|
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 |