|  | 
| Two toolbars in a row | 
| Post Reply   | 
| Author | |
| Sebastià   Newbie   Joined: 31 March 2005 Location: Spain Status: Offline Points: 1 |  Post Options  Thanks(0)  Quote  Reply  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à | |
|  | |
| SuperMario   Senior Member     Joined: 14 February 2004 Status: Offline Points: 18057 |  Post Options  Thanks(0)  Quote  Reply  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 | |
|  | |
| Post Reply   | |
| Tweet | 
| Forum Jump | Forum Permissions  You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |