CommandBars Articles and Tutorials

Removing the Expand Button from a ToolBar

Author: Mike Palmatier
Platform: Visual Basic 6.0

The Expand Button is the button displayed at the end of a toolbar and it displays a list of the buttons on the toolbar so that the user can easily hide or show them. At the bottom of the list is a customize option to further customize the toolbars.

Expand button

The code below will remove the Expand Button from all the tool bars.

CommandBars.Options.ShowExpandButtonAlways = False

You can also hide the Expand Button for toolbars on an individual basis. To do this, you need to set the value of the ShowExpandButton property for each individual toolbar. This can be used to override the effects of ShowExpandButtonAlways for individual toolbars.

The code below will show the Expand Button for the first toolbar. Note that CommandBar(1) is the ActiveMenubar.

CommandBars(2).ShowExpandButton = True