ShellAppBar - Convert Your Forms Into Appbars With Autohide, Drag-Docking And Multi-Monitor Support

The ShellAppBar component from ShellObjects makes it very easy to develop Quick Launch like appbars (application desktop toolbars) with complete autohide functionality, support for drag-docking and support for multi-monitor configurations. This article discusses how easy and fast it is to quickly convert your forms or dialog boxes into application desktop toolbars with the ShellAppBar component from ShellObjects. ShellObjects is available as an ActiveX control (supports VB, Visual C++, Borland Delphi, Borland C++ and any other developing tool supporting ActiveX controls) and as a .Net component (supports VB.Net, C#, Managed C++ and any other language which supports the .Net platform).

What are appbars (application desktop toolbars)?

An appbar (application desktop toolbar) is a window similar to the Quick Launch bar, the Language Bar or the Windows Taskbar. It is anchored/docked to an edge of the screen, and it typically provides the user with quick access to various things like program shortcuts, favorite files, folders or URLs, information such as the local weather or sports news, or commonly used programs such as a clock, stopwatch or a calculator. Appbars are allocated their own area on the screen and the system prevents other applications from using that area. Multiple appbars can exist on the system at any time.

Developing appbars with the ShellAppBar component from ShellObjects

The ShellAppbar component from ShellObjects makes it extremely easy to develop appbars. Simply put the ShellAppBar component on the form or dialog box and it is automatically converted into an appbar when it is loaded. ShellAppBar provides convenient properties for specifying the screen edge to which the appbar should be docked/anchored and to specify whether the appbar should be autohidden or visible all the time. Other properties allow you to specify whether resizing of appbars should be allowed, whether drag-docking (dragging an appbar to different edges of the screen to dock it to that edge) should be allowed and whether the appbar should always be on top of all other windows.

Advanced Features

Specifying the docking edge

The DockingEdge property of ShellAppbar specifies the screen edge to which the form or dialog box should be docked. By simply changing the value of the DockingEdge property, the form or dialog box can be docked to a different screen edge. To undock the appbar, simply set the DockingEdge property to None.

AutoHide functionality

Appbars developed with ShellAppBar support full autohide functionality. An autohidden appbar is normally hidden but becomes visible when the user moves the mouse cursor to the edge of the screen to which the appbar is docked. The appbar hides itself again when the user moves the mouse cursor out of the its bounding rectangle. The system allows a number of different appbars at any given time but it allows only one autohide appbar at a time for each screen edge. The first appbar which requests to be autohidden is granted that permission. Attempting to make another appbar autohidden to the same screen edge fails.

The AutoHide property of ShellAppBar specifies whether the appbar should be autohidden or not. As discussed above, setting this property to True does not guarantee that the appbar will be autohidden. The IsAutoHidden property can be used to determine whether the appbar is really autohidden or not. The AutoHiddenAppBarState property can be used to determine whether an autohidden appbar is currently hidden or fully visible.

Drag-Docking

Appbars developed with ShellAppBar can be dragged to a screen edge to dock to that screen edge. In this way, the user can be given full control over which screen edge the appbar docks itself to. The AllowedDragDockingEdges property enables or disables this functionality. Setting to property to None disables this functionality. This property can also be set to a combination of screen edges to allow drag-docking only to those edges of the screen.

Multi-Monitor support

Appbars developed with ShellAppBar have full support for multi-monitor system configurations. The appbars can be docked to any edge of any monitor. Drag-docking across multiple monitors is also fully supported.

Editions and supported development tools, environments and technologies

ShellObjects comes in two separate editions - ActiveX and .Net

ActiveX edition

The ActiveX edition fully supports Visual Basic (VB), Visual C++ (VC++, MFC, ATL), Borland Delphi, Borland C++ Builder and a lot of developing environments and IDEs which have support for ActiveX controls. As mentioned above, simply drag and drop a ShellAppbar component on your form or dialog box and it will be automatically converted into an appbar when it is loaded.

.Net Edition

The .Net edition is a 100% .Net component and supports Visual Studio.Net 2002, Visual Studio.Net 2003 and the latest Visual Studio 2005. It supports all version of the .Net runtime library including .Net 1.0, .Net 1.1 and the latest .Net 2.0. It supports a variety of .Net languages include Visual Basic.Net (VB.Net), C# and Managed C++. Using ShellAppbar on your Windows Forms is just as simple - simply drag and drop a ShellAppBar component on your form and it will be automatically converted into an appbar when it is loaded.

Conclusion

The ShellAppBar component from ShellObjects makes it very easy to develop Quick Launch like appbars (application desktop toolbars). With ShellAppbar you can automatically convert your forms and dialog boxes into appbars with minimal effort and with full support for advanced features such as autohide functionality, support for drag-docking, automatic resizing and support for multi-monitor configurations.

For more information on ShellObjects, visit the product website at ShellObjects Product Website.

G Himangi is a Senior Software Developer at Sky Software (http://www.ssware.com) and is a member of Sky Software's component and controls development team.