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

Keep a Toolbar from 'wrapping' to the next Row when there are too many Buttons to display

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

The CommandBars.EnableDocking method is used to apply the xtpFlagHideWrap flag from the XTPToolBarFlags enumeration. This will keep the toolbar from 'wrapping' to the next row. Instead, a special expand button is displayed that indicates to the user that there are more buttons that can not be seen. You simply click on the expand button to display the hidden buttons.

The picture below illustrates a toolbar with hidden buttons.



The picture below shows how the hidden buttons are displayed when the expand button is clicked.



The code below illustrates how to disable toolbar 'wrapping' and allow the toolbar to be docked to any location in the application.

 Dim ToolBar As CommandBar

 

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

 ToolBar.EnableDocking xtpFlagHideWrap Or xtpFlagAny

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.