Print Page | Close Window

Icons in Toolbar

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=8766
Printed Date: 18 June 2025 at 3:59am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Icons in Toolbar
Posted By: lexicon
Subject: Icons in Toolbar
Date Posted: 13 November 2007 at 7:10am
Hello
 
I'm trying to understand how you are loading icons in your toolbar.
Let's say the example TabbedToolbar.vbp
Where are the icons come from?



Replies:
Posted By: Oleg
Date Posted: 13 November 2007 at 11:29am
See
 
 ImageManager.Icons.LoadIcon App.Path & "\Icons\App.ico", ID_TAB_ICON, xtpImageNormal
line.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: lexicon
Date Posted: 13 November 2007 at 2:01pm
I'm running this code and i take 2 toolbars
 
    Dim ToolBar As CommandBar
   
    Set ToolBar = CommandBars.Add("Standard", xtpBarTop)
    CommandBars.Options.LargeIcons = 1
    AddControl ToolBar.Controls, xtpControlButton, 100, "&New", False, "Create a new document"
    AddControl ToolBar.Controls, xtpControlButton, 101, "&Open", False, "Open an existing document"
    AddControl ToolBar.Controls, xtpControlButton, 102, "&Save", False, "Save the active document"
    AddControl ToolBar.Controls, xtpControlButton, 103, "&Save All", False, "Save all documents"
    AddControl ToolBar.Controls, xtpControlButton, 104, "Cu&t", True, "Cut the selection and put it on the Clipboard"
    AddControl ToolBar.Controls, xtpControlButton, 105, "&Copy", False, "Copy the selection and put it on the Clipboard"
       
   ' AddControl ToolBar.Controls, xtpControlButton, ID_VIEW_PROPERTIES, "Properties", True
   ' AddControl ToolBar.Controls, xtpControlButton, ID_HELP_ABOUT, "About", True
     Set CommandBars.Icons = ImageManager.Icons
    CommandBars.Options.UseDisabledIcons = True
    UseDisabledIcons = True
    CommandBars.Options.SetIconSize True, 32, 32
   
    CommandBars.Options.ShowExpandButtonAlways = False
    CommandBars.VisualTheme = xtpThemeOffice2003
Can you tell me how the first toolbar created?


Posted By: Oleg
Date Posted: 14 November 2007 at 1:00am
This code creates only one toolbar. check that you call it only once.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: lexicon
Date Posted: 14 November 2007 at 2:52am

This is the code that creates 2 toolbars, the 1st is empty

Private Sub Form_Load()
    Dim ToolBar As CommandBar
   
    Set ToolBar = CommandBars.Add("Standard", xtpBarTop)
    CommandBars.Options.LargeIcons = 1
    AddControl ToolBar.Controls, xtpControlButton, 100, "Κινήσεις", True
    AddControl ToolBar.Controls, xtpControlButton, 107, "Πελάτες", True
    AddControl ToolBar.Controls, xtpControlButton, 108, "Ταινίες", True
    AddControl ToolBar.Controls, xtpControlButton, 103, "Χρεώσεις", True
    AddControl ToolBar.Controls, xtpControlButton, 104, "Στατιστικά", True
    AddControl ToolBar.Controls, xtpControlButton, 105, "Κρατήσεις", True
       
    AddControl ToolBar.Controls, xtpControlButton, 106, "Οικονομικά", True
    AddControl ToolBar.Controls, xtpControlButton, 109, "Αποσύνδεση", True
    AddControl ToolBar.Controls, xtpControlButton, 110, "Ρυθμίσεις", True
   
     Set CommandBars.Icons = ImageManager.Icons
    CommandBars.Options.UseDisabledIcons = True
    UseDisabledIcons = True
    CommandBars.Options.SetIconSize True, 32, 32
   
    CommandBars.Options.ShowExpandButtonAlways = False
    CommandBars.VisualTheme = xtpThemeOffice2003
End Sub


Posted By: ijwelch
Date Posted: 15 November 2007 at 11:34pm
The first empty bar is the default 'menubar', created automatically.

You need to call CommandBars.DeleteAll at the start of your code to remove it.




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