Print Page | Close Window

Two toolbars in a row

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=2062
Printed Date: 17 November 2024 at 7:36pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Two toolbars in a row
Posted By: Sebastià
Subject: Two toolbars in a row
Date Posted: 31 March 2005 at 9:41am
Is it possible to create programatically two toolbars in a row?

Thanks in advence

Sebastià



Replies:
Posted By: SuperMario
Date Posted: 31 March 2005 at 9:45am
Yes, you can.

'This code adds the toolbars,
  Dim ToolBar As CommandBar
  
  Set ToolBar = CommandBars.Add("Standard", xtpBarTop)
  With ToolBar.Controls
    ............. 
  End With
  
  Dim ExtendedBar As CommandBar
  Set ExtendedBar = CommandBars.Add("Extended", xtpBarTop)
  With ExtendedBar.Controls
       ...........  ;   
  End With
   
'This code docks a toolbar to the right of another toolbar
  DockRightOf ExtendedBar, ToolBar, False

'This is the code for the DockRightOf function
Private Sub DockRightOf(BarToDock As CommandBar, BarOnLeft As CommandBar, Optional VerticalBar As Boolean = False)
  Dim Left As Long
  Dim Top As Long
  Dim Right As Long
  Dim Bottom As Long
  
  CommandBars.RecalcLayout
  BarOnLeft.GetWindowRect Left, Top, Right, Bottom
  
  If (Not VerticalBar) Then
    CommandBars.DockToolBar BarToDock, Right, (Bottom + Top) / 2, BarOnLeft.Position
  Else
    CommandBars.DockToolBar BarToDock, (Left + Right) / 2, Bottom, BarOnLeft.Position
  End If
End Sub  



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