Guides & Tutorials (beta)

Specify where a Toolbar can be Docked

by Mike Palmatier Visual Basic 6 Created on 10/21/2005  |  Updated on 07/30/2024 0/5 ( 0 votes )

The CommandBars.EnableDocking method is used to specify where a toolbar can be docked, and how it is displayed. The XTPToolBarFlags enumeration contains the different toolbar options that can be applied with the EnableDocking method. You can combine values to tailor to your needs, for example, you can specify that the toolbar can be docked only to the top or bottom of the application.

The picture below illustrates toolbars docked to several different locations in the application.

toolbars docked many locations

The code below illustrates how to limit a toolbar so that is can only be docked to the top and bottom of the application, or it can be a floating toolbar.

Dim ToolBar As CommandBar

Set ToolBar = CommandBars.Add("Standard", xtpBarTop)
ToolBar.EnableDocking xtpFlagAlignBottom Or xtpFlagAlignTop _
                      Or xtpFlagFloating

The completely disable docking, simply pass in a 0 or a flag such as xtpFlagStretched into the EnableDocking method for a toolbar.

Dim ToolBar As CommandBar

Set ToolBar = CommandBars.Add("Standard", xtpBarTop)
ToolBar.EnableDocking 0

User Comments

No comments yet, sign in to comment.

Secure Transactions

Online transactions are secure and protected.


Ssl seal 1
This site is protected by Trustwave's Trusted Commerce program
CompliAssure Secured

Money Back Guarantee

If you are not 100% happy with your purchase within 30 days, you can return it for any reason. Your satisfaction is our priority!


Satisfication Guarantee

Contact sales@codejock.com for more details.