Knowledge Base 
Adding One or More CommandBars on the Same Row 
 Friday, April 26, 2024

Adding One or More CommandBars on the Same Row

By default, when a commandbar is added, the commandbar appears on a separate row. Each commandbar added will then appear under the previous commandbar. However, many times it is useful to dock a commandbar next to another on the same row using code.

In the picture below, you can see that commandbar "Navigation" has been docked next to commandbar "Standard". This was done using the following code:

ThisForm.cmdBarNavigation.DockRightOf( ThisForm.cmdBarStandard)









In the picture below, you can see that commandbar "Navigation" has been docked to the right on the same row with commandbar "Standard". This was done using the following code:

ThisForm.cmdBarNavigation.Dock( 0, ThisForm.Width, ThisForm.cmdBarStandard.Top)









Note: the DockRightOf and Dock methods can be used after the InitCommandBars method of the CommandBarsManager object is called.