Guides & Tutorials (beta)

Stretch a Toolbar to Fill the Entire Width of the Application

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 apply the xtpFlagStretched flag from the XTPToolBarFlags enumeration. This will keep stretching the toolbar the entire width (if horizontal) of the application, even when there are not enough buttons to fill the toolbar. With the xtpFlagStretched flag, no other toolbars can be docked on the same row. Note that this is the default setting given to the ActiveMenuBar.

The picture below illustrates a toolbar with hidden buttons.

Toolbar with hidden buttons

If you would like to stretch a toolbar and also allow other toolbars to be docked on the same row you can use the xtpFlagStretchedShared flag.

The code below illustrates how to stretch a toolbar the entire width of the application.

Dim ToolBar As CommandBar

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

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.