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

Adding a ToolBar

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

The CommandBars.Add method is used to add a blank toolbar. The method accepts both a name and toolbar position for the toolbar. The name given to the toolbar is seen when customizing toolbars. It is recommended that you name the toolbar to a meaningful name that summarizes what type of tasks the group of buttons on the toolbar perform. The toolbar position indication where the toolbar will be located when it is added, available locations are stored in the XTPBarPosition enumeration. Locations the toolbar can be placed include the top, bottom, left, and right side of your application. The toolbar can also start out floating.

The picture below illustrates a blank toolbar.



The code below illustrates how to add a blank toolbar to the top of your application.

 

 Dim ToolBar As CommandBar

 

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

 

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.