Toolbar Controls for Microsoft® OfficeAdd-in Express Home > Add-in Express for Office and .NET > Online Guide > Add-in Express components > Custom Toolbar Controls Custom Toolbar Controls
The Add-in Express Extensions for Microsoft Office Toolbars (or the Toolbar Controls) is a plug-in for Add-in Express designed to overstep the limits of existing CommandBar
controls. With the Toolbar Controls, you can use any .NET controls, not only Office controls, on your command bars. Now you can add any button to the Office toolbar as well as
tree-views, grids, diagrams, edit boxes, reports and other controls.
To make the text below easy to read, let's define three terms, namely:
- Command bar controls are controls such as a command bar button and command bar combo box provided by the Office object model. These controls are built-in Office controls and they are supported by Add-in Express.
- Non-Office controls are any controls, both .NET built-in and third-party controls, such as tree-views, grids, edit boxes, combo boxes, labels, images, user controls, etc. Usually, you use these controls on forms of your Windows applications.
- Advanced command bar control is an instance or ADXCommandBarAdvancedControl or the ADXCommandBarAdvancedControl class itself (depending on the context).
What is ADXCommandBarAdvancedControl
If you have developed at least one add-in based on Add-in Express, you probably ran into ADXCommandBarAdvancedControl when adding command bar controls
to your command bars. Yes, it is that strange item of the Add button on the ADXCommandBarControl collection editor.
This plug-in gives you a chance to use any non-Office controls such as tree-views, grids, labels, edit and combo boxes, diagrams on any Office command bars.
Now you can add ADXCommandBarAdvancedControl, an advanced command bar control, to your command bar and bind it to any non-Office control you placed on the
add-in module. As a result, you will have your grid, tree-view or image placed on your command bar.
Hosting any .NET controls
In addition to properties common for Office command bar controls, ADXCommandBarAdvancedControl has one more property. It is the Control property,
the most important one. With this property, you can select a non-Office control to place it on your command bar. Have a look at the picture below.
The add-in module contains five controls - MyCalendar, MyDataGrid, MyNumericUpDown, MyTreeView and MyUserControl. The Control property asks you to
select one of these controls. If you select MyUserControl, your add-in adds MyUserControl to your command bar. With the Control property,
DXCommandBarAdvancedControl becomes a host for your non-Office controls.

On .NET, ADXCommandBarAdvancedControl supports all controls based on System.Windows.Forms.Control. So, on your command bars, you can use both built-in
controls and third-party controls based on System.Windows.Forms.Control. Just add them to the add-in module, add an advanced command bar control
to your command bar and select your non-Office control in the Control property of ADXCommandBarAdvancedControl.
The Toolbar Controls is a set of control adapters
You may ask us what the Toolbar Controls described above does, if ADXCommandBarAdvancedControl is already included in Add-in Express. In general,
ADXCommandBarAdvancedControl is still abstract in Add-in Express, but it is implemented by the Toolbar Controls if it is plugged into Add-in Express.
So, our answer is: the Toolbar Controls for Microsoft Office implements ADXCommandBarAdvancedControl for each Office application.
The Toolbar Controls adds a new tab, "Toolbar Controls for Microsoft Office", to the Toolbox and places several components on the tab (see the picture below).
The Toolbar Controls supports each Office application by special components that we call Control Adapters. Only Control Adapters know how to add your controls
to applications specific command bars. So, the Control Adapters are the Toolbar Controls itself.
In Express editions of Visual Studio, you need to add the control adapters manually.

The add-in module can contain control adapters only. For example, you should add an ADXExcelControlAdapter to the add-in module if you want
to use non-Office controls in your Excel add-in. To use non-Office controls on several Office applications you should add several control
adapters. For example, if you need to use your controls in your add-in that supports Outlook, Excel, and Word, you should add three control
adapters: ADXExcelControlAdapter, ADXWordControlAdapter, and ADXOutlookControlAdapter to the add-in module.
Back to Add-in Express for Office and .NET homepage |