Building custom Internet Explorer bars and IE
context menu commands / items - VB.NET, C#, C++
Add-in Express™
for Internet Explorer® and Microsoft® .net
Add-in Express Home > Add-in Express for Internet Explorer > Online Guide > Building Explorer bars and context menus
Custom Explorer bars
Add-in Express for Internet Explorer makes it easy to build custom Explorer bars and to create custom menu items, or commands for the Internet Explorer context menu in VB.NET, C#, C++ and Chrome.
A custom Explorer bar is available for the user in the View | Explorer Bar | %MenuText% menu of Internet Explorer.
The ideology of creating custom Explorer bars is similar to that of IE toolbars. With Add-in Express for Internet Explorer, a custom Explorer bar is built in two easy steps: first, you add a special component derived from UserControl to your project, then you add an item to a collection of the IE module and bind the component to the item.
Let's go. First, add a special class to your IE add-on project; the name of the class is AddinExpress.IE.ADXIEBar and you can find it in the Add New Item dialog (see the picture below).

This class is just an empty Explorer bar. Because it is derived from UserControl, you can use Toolbox in the Visual Studio IDE to populate the bar with controls. Note that in its context menu, the component provides the Add Keyboard Shortcut command; use it to add an appropriate component to your Explorer bar.

The second step (and we are creating a custom Explorer bar) is to add an item to the Bars collection of the IE module. This item, of the ADXIEBarItem type, binds the ADXIEBar to a number of settings as you can see below.

ADXIEBarItem provides the following properties:
- AddToolButton - if true, shows a button in the built-in IE toolbar; the button is associated with the Explorer bar.
- BarType - it's the most important property, it binds an ADXIEBar to its item; just select one from the list.
- DockPosition - the available positions are vertical (at the left of the IE window) and horizontal (at the bottom).
- HelpText - it is displayed in the status bar when the user moves the mouse over the View | Explorer Bar | %MenuText% item in the IE menu.
- LoadAtStartUp - when false, the Explorer bar is not visible; the user has to check the View | Explorer Bar | %MenuText% item in the IE menu.
- MaxSize -specifies the maximal size of the bar; the default value, which is -1, means "no restrictions".
- MenuText - the caption of the menu item corresponding to the bar.
- MinSize - specifies the minimal size of the Explorer bar; the default value, which is -1, means "no restrictions".
- Title -the text to be shown in the bar caption.
- ToolButtonActiveIcon - this property is obligatory when AddToolButton is true; the icon must be located in the Resources folder of your Internet Explorer add-on project.
- ToolButtonDefaultVisible - when true, the button is visible at the IE add-on startup; when false, the user has to add the corresponding button via Customize Command Bar | Add or Remove Commands.
- ToolButtonInactiveIcon - this property is obligatory when AddToolButton is true; the icon must be located in the Resources folder of your IE add-on project.
Also note that the AddinExpress.IE.ADXIEToolBar provides all Internet Explorer events, see a complete list of available Internet Explorer events.
Custom IE context menu commands
To create a custom Internet Explorer context menu item /command, add an item to the ContextMenu collection of the IEModule and specify the item's properties: caption and contexts available for the context menu item.

Naturally, you need to handle the Click event of the context menu item / command.

More about creating custom IE context menu items. See also a video sample about how to create an IE context menu item.
Back to Add-in Express for Internet Explorer homepage

