Add button, tree-view, combo box, grid, label to
Microsoft Office toolbar / command bar in C#, VB.NET, C++
Toolbar Controls
for Microsoft Office
Add-in Express Home > Toolbar Controls for Office > Online Guide > How Toolbar Controls works
Getting started on .NET
The Toolbar Controls for Microsoft Office is a visual tool. It is based on the Windows API and comprised of over twenty internal classes. But all the internal classes were designed to provide only one type of public components, the Control Adapters. This makes the Toolbar Controls easy-to-use in accordance with the true RAD paradigm. So, the Toolbar Control for Microsoft Office provides a very comfortable way to enhance the GUI of your MS Office add-ins with minimal service coding in C#, VB.NET, C++. You write your applied code only. See a sample project showing how quickly you can add a custom .NET control to Outlook toolbar.
This section shows how you can quickly get started with the Toolbar Control for Microsoft Office in Visual Studio .NET and describes what the Toolbar Controls adds to your add-ins based on Add-in Express.
Terms
- 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, 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).
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 (see the red arrow on the picture below). Add-in Express documentation says nothing about it. On our forums, to all questions regarding this we gave the answer like "ADXCommandBarAdvancedControl is reserved for future purposes". It's true. We reserved it for one more plug-in for our Add-in Express. That plug-in is the Toolbar Controls.

We reserved ADXCommandBarAdvancedControl to give you a chance to use any non-Office controls such as tree-view, grid, label, image, 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. Your grid, tree-view or image is placed on your command bar as the result.
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 property. 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 ADXCommandBarAdvancedControl 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.

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 Toolbar Controls for Office homepage

