Print Page | Close Window

Remove Toolbar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4594
Printed Date: 17 November 2024 at 7:39am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Remove Toolbar
Posted By: Manuel
Subject: Remove Toolbar
Date Posted: 14 July 2006 at 9:59am
Can I insert a toolbar in a form unless create a menu?
In this moment i'm not able to do this!!
This is my code in vb
Thanks


'****************CODE***********************'
Private Sub AddToolbar()

    Dim Control As CommandBarControl
    Dim ControlFile As CommandBarPopup, ControlEdit As CommandBarPopup, ControlView As CommandBarPopup
    Dim ControlSelect As CommandBarPopup, ControlInsert As CommandBarPopup, ControlFormat As CommandBarPopup, ControlHelp As CommandBarPopup
   
    Set ControlFile = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&File", -1, False)
    With ControlFile.CommandBar.Controls
        .Add xtpControlButton, 1, "&New"
        .Add xtpControlButton, 2, "&Open"
       
        Set Control = .Add(xtpControlButton, 3, "&Close")
        Control.BeginGroup = True
       
        .Add xtpControlButton, 54, "&Save", -1, False
       
        Set Control = .Add(xtpControlButton, 6, "Print Set&up...")
        Control.BeginGroup = True
        .Add xtpControlButton, 7, "Print Pre&view"
        .Add xtpControlButton, 8, "&Print"
       
        Set Control = .Add(xtpControlButton, 9, "&Exit", -1, False)
        Control.BeginGroup = True
    End With
   
    Dim ToolBar As CommandBar
    Set ToolBar = CommandBars.Add("Standard", xtpBarTop)
    With ToolBar.Controls
        .Add xtpControlSplitButtonPopup, ID_FILE_NEW_ARCHIVE, "&New"
        .Add xtpControlButton, ID_FILE_OPEN_ARCHIVE, "&Open"
        .Add xtpControlButton, ID_FILE_FAVORITES, "Favorites"
        .Add xtpControlButton, ID_ACTIONS_ADD, "Add"
        .Add xtpControlButton, ID_ACTIONS_EXTRACT, "Extract"
        .Add xtpControlButton, ID_ACTIONS_VIEW, "View"
        .Add xtpControlButton, ID_ACTIONS_CHECKOUT, "Checkout"
        .Add xtpControlButton, ID_FILE_WIZARD, "Wizard"
    End With
    ToolBar.ShowTextBelowIcons = True

    'Change Icon Size
    ToolBar.SetIconSize 42, 35

    'Disable MenuBar Docking
    CommandBars.ActiveMenuBar.EnableDocking xtpFlagStretched
    'Disable ToolBar Docking
    ToolBar.EnableDocking xtpFlagHideWrap

    Dim Items()
    Items = Array(ID_FILE_NEW_ARCHIVE, ID_FILE_OPEN_ARCHIVE, ID_FILE_FAVORITES, ID_ACTIONS_ADD, ID_ACTIONS_EXTRACT, _
            ID_ACTIONS_VIEW, ID_ACTIONS_CHECKOUT, ID_FILE_WIZARD)

    If (ImageManager.IsAlphaIconsSupported) Then
        ImageManager.Icons.LoadBitmap "C:\Programmi\Codejock Software\ActiveX\Xtreme SuitePro ActiveX 2006\samples\CommandBars\VB\StaticBars\Icons\alphaclr.bmp", Items, xtpImageNormal
        ImageManager.Icons.LoadBitmap "C:\Programmi\Codejock Software\ActiveX\Xtreme SuitePro ActiveX 2006\samples\CommandBars\VB\StaticBars\Icons\alphaclrsm.bmp", Items, xtpImageNormal
    Else
        ImageManager.Icons.LoadBitmap "C:\Programmi\Codejock Software\ActiveX\Xtreme SuitePro ActiveX 2006\samples\CommandBars\VB\StaticBars\Icons\highclr.bmp", Items, xtpImageNormal
        ImageManager.Icons.LoadBitmap "C:\Programmi\Codejock Software\ActiveX\Xtreme SuitePro ActiveX 2006\samples\CommandBars\VB\StaticBars\Icons\highclrsm.bmp", Items, xtpImageNormal
    End If
    CommandBars.Icons = ImageManager.Icons

    CommandBars.Options.UseDisabledIcons = True
    CommandBars.Options.ShowExpandButtonAlways = True


    'ommandBars.KeyBindings.Add FCONTROL, Asc("N"), ID_FILE_NEW_ARCHIVE
    'CommandBars.KeyBindings.Add FCONTROL, Asc("O"), ID_FILE_OPEN_ARCHIVE
           
End Sub


-------------
Corsos



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