Custom Internet Explorer bars and advanced IE bars
developed for IE 11 - IE 6 in VB.NET, C# or 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

Custom Explorer bars

With Add-in Express for Internet Explorer you can build custom Explorer bars for IE6, IE7, IE8 and IE9. Add-in Express provides 2 ways:

This pages describes the development of:

Building custom Explorer bars

The newly created IE bar has the command button (unavailable in IE6) and / or menu item associated with the IE bar; the user shows / hides the bar by clicking on either of them.

The ideology of creating custom Explorer bars is similar to that of IE toolbars. Note however that you need to have administrative permissions in order to install an IE add-on that shows your IE bar. At the same time, the Add-in Express IE Bar project allows developing an IE bar installable by the standard user. Also note that the BHO part of an Internet Explorer add-on can switch your IE bar on when Internet Explorer starts - this is why Add-in Express provides the LoadAtStartup property; the same isn't possible with the IE bar developed with the Add-in Express IE Bar project.

If you develop an Add-in Express IE add-on, a custom Explorer bar is built in two easy steps: first, you add a special component derived from System.Windows.Forms.UserControl to your project, then you add an item to a collection of the IE module and, in the item's properties, you bind the component to the item.

Let's start: choose Project | Add New Item in the main menu of VS and find the corresponding class template in the Add-in Express Items / Internet Explorer branch.

Adding a new Explorer bar to your IE add-on project

This adds a descendant of ADXIEBar (it represents an Internet Explorer bar) to your project.

IE Bar Collection Editor

Now you add an item to the Bars collection of the IE module and specify its properties. The most important one is BarType; it binds a bar component to the bar item (ADXIEBarItem). You can also choose whether to show the bar vertically or horizontally and specify the maximal width or height of vertical and horizontal bars respectively. The properties having "ToolButton" in their names, such as AddToolButton and ToolButtonDefaultVisible, control the visibility and other aspects of the button that shows / hides the Explorer bar; the button is added to the Command Bar toolbar of Internet Explorer.

Here are ADXIEBar events listed in the order corresponding to the life-cycle of the Explorer bar:

  • OnConnect
  • OnBeforeShow
  • OnBeforeShowEx - allows you to prevent the Explorer bar from being shown
  • OnActivate
  • OnDeactivate
  • OnBeforeHide
  • OnBeforeHideEx - allows you to cancel hiding the IE bar
  • OnDisconnect

Because ADXIEBar is a descendant of UserControl, you can react to, say, resizing of the Explorer bar.

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 Internet Explorer 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 Internet Explorer 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.

On using Advanced IE Bars

As you may happen to know, IE bars have several limitations. For instance, they require creating registry keys in order to be ever displayed. This means you cannot create an IE bar on the fly. To bypass this and other restrictions of Internet Explorer bars, you use Advanced IE Bars by Add-in Express.

When using the Advanced IE Bar technology you will have the following components in your code:

  • Advanced IE Bar - it descends from System.Windows.Forms.UserControl to comply with the Internet Explorer environment and to provide the designer surface for the controls that constitute the UI of your IE bar; it also provides a number of properties and events allowing you to control how your IE bar looks like;
  • Advanced Bar Item - it describes the behavioral aspects of your Internet Explorer bar; for instance it specifies the layout in which the Explorer bar is shown as well as the keyboard shortcut that turns your IE bar off and on;
  • Advanced Bars Manager - it provides the collection of Advanced Bar items.

To use the components listed above, you add an Advanced IE bar to your IE Module based project.

Advanced IE Bar in the Add New Item dialog

Then, you add an Advanced Bars Manager onto the designer surface of the IE module in your project.

Adding an Advanced Bars Manager to the IE module

Finally, you add an item to the Bars collection of the Advanced Bars Manager and set the item's properties.

Opening the collection editor of the Bars property

Advanced IE Bar Collection Editor

Advanced Bar pros and cons

  • Advanced IE Bar supports four layouts, IE bar supports only two layouts
  • The user may drag-n-drop an Advanced IE bar to a new layout; IE bars lack of this possibility
  • The header of the Advanced IE bar is customizable to a large degree; IE bars lack this possibility
  • Advanced IE bars are not supported in IE 6; standard IE bars work in IE 6

Showing / hiding Advanced IE Bar

When a new Internet Explorer tab opens, the Advanced Bars Manager gets all enabled items from its Bars collection and raises the OnCreateBarInstance event for each of them; if the end user has chosen not to show the bars, they are excluded from the sequence, too.

If you don't cancel the OnCreateBarInstance event, the manager creates an instance of the Advanced component specified in the ADXIEAdvancedBarItem.BarType property. Before the bar is shown, the OnBarBeforeShow event of the Advanced IE bar occurs. You can cancel this event, too.

Similarly, you can prevent the Advanced IE bar from being closed by the user - you'll need to cancel the OnBarBeforeHide event.

Customizing IE main menu and context menus <<

>> Intercepting IE and HTML events, keyboard shortcuts