Toll Free: (877) 723-1442 U.S. and Canada
Support
ActiveX / COM
Visual C++ / MFC
Customer Spotlight
Corporate Partners
Contact Sales

Call center available M-F 9:00 - 6:00 US Eastern Time.

U.S. and Canada
(877) 723-1442

International
(517) 625-5729

Email

Specify where a Toolbar can be Docked

Author: Mike Palmatier
Posted: October 21, 2005
Environment: Visual Basic 6.0

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.



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

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Other products and/or company names may be trademarks or registered trademarks of their respective owners.