Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - Two toolbars in a row
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Two toolbars in a row

 Post Reply Post Reply
Author
Message
Sebastià View Drop Down
Newbie
Newbie


Joined: 31 March 2005
Location: Spain
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sebastià Quote  Post ReplyReply Direct Link To This Post Topic: Two toolbars in a row
    Posted: 31 March 2005 at 9:41am
Is it possible to create programatically two toolbars in a row?

Thanks in advence

Sebastià
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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  
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.