Add a custom button to Outlook Express (OE)
and Windows Mail toolbar in C#, VB.NET, C++

Add-in Express™
for Outlook® Express and Microsoft® .net

Add-in Express Home > Add-in Express for Outlook Express > Online Guide > Creating custom Outlook Express toolbars

Custom Outlook Express toolbars

Add-in Express gives you an easy way to create a custom toolbar for Outlook Express and Windows Mail add-ins in C#, VB.NET, C++. To do this, you right-click the design surface of the add-in module and choose an appropriate Add-in Express component in the context menu.

There are two toolbar components available in the context menu: Explorer Toolbar and Inspector Toolbar. Essentially, they work on the same principle. As their names suggest, these components add a toolbar to the Explorer window or to Inspector windows. They provide the ButtonImageSize property that allows specifying the actual image size for all buttons on the toolbar: Small corresponds to 16x16, Normal - 24x24, and Large means 32x32 bitmaps. This property can be set at design-time only. In the same way, you specify the text position for all toolbar controls on the OE toolbar.

As to customizing Outlook Express built-in toolbars, we are sorry but it is not possible in the current Add-in Express version.

Outlook Express toolbar buttons

The Controls property editor allows adding custom controls to the Outlook Express toolbar.

Creating toolbar buttons for OE

The controls are buttons, in fact. There are four Outlook Express button styles available for the developer: just choose a value in the Style property of a button component.

Outlook Express toolbar button styles

There are four possible values of the Style property.

  • bsButton. This value of the Style property generates an ordinary button. When clicked, it generates the Click event. You can add a number of other buttons into its Controls collection but they will never be shown. Also, its Checked property cannot be changed. The AdxoeToolbarButton1 button on the picture above is an example of such a button.
  • bsCheckedButton. This value corresponds to a button that can change its checked state. When clicked, it reverts its Checked property and generates the Click event. You can add a number of other buttons into its Controls collection but they will never be shown. The AdxoeToolbarButton2 button on the picture above is an example of such a button.
  • bsButtonPopup. This value corresponds to a special type of a split button. When any part of this button is clicked, the button doesn't generate the Click event. Instead, it shows a popup menu that lists all other buttons from its Controls collection. It isn't possible to show icons for those buttons. The AdxoeToolbarButton3 button on the picture above is an example of such a button.
  • bsSplitButtonPopup. This value corresponds to a split button. When the main part of this button is clicked, the button generates the Click event. When the options part is clicked, the button shows a popup menu that lists all other buttons from its Controls collection. It isn't possible to show icons for those buttons. The AdxoeToolbarButton4 button on the picture above is an example of such a button.

The following screenshot demonstrates four OE button styles in action:

Outlook Express toolbar button styles

Processing custom toolbar buttons

The only event provided by a button is Click. In the Properties window, use the combo box at top of the window to choose the button. Then, switch to the Events view and double-click the event of your choice:

Creating an event handler for a button

This creates the event handler and opens the code window. Now you just write the code.

Developing Outlook Express add-in project <<

>> Customizing Outlook Express menus