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
|