Introduction

This is a control that behaves like the tab control, but has visual cues that look more like the navigation panel in Outlook. Since this is more of a tab control than a navigation panel control, you are free to add as many tabs as you like. The control is made of a collection of tabs, where each tab has two drawing surfaces and an icon. The icon is used when a tab is not visible. Please note that this control is not thread-safe; I will make it thread-safe at some point. If you are interested in making it thread-safe, you will have to modify the Change theme code in all of the controls in the solution.

How to Use the Control

Include the following DLLs in your project debug directory, or at least in a directory whose path is known to VS. Better yet, place them in the GAC:

AdrdCBC.dll

AdrdHDC.dll

AdrdNavigationThemes.dll

AdrdTBC.dll

HDCUserControl.dll

NavCtl.dll

OtherThemes.dll

Set a reference to NavCtl.dll in your project.

Add the control to your toolbox. To do this, right click on the toolbox and click "Choose Items."

Important Steps

Make sure all your user controls (tabs) inherit from HDCControl.

publicpartialclass YOURCONTROL : HDCUserControl.HDCControl

To actually make the control pass values back and forth between the different surfaces and/or the containing form, always call the OnAction method of the HDCControl instant. For example, if you included a TreeView control on your HDCControl instant drawing surface and you want to update your containing form with the node text when the node selected is changed, you would do the following:

Call the OnAction method in the TreeView AfterSelection event handler like this:

OnTabAction will pass you the HDCControl control instant that raised the OnAction event and the AdrdNavigationTab item. So, you can have both drawing surfaces to the control and can cause changes on either of the drawing surfaces and/or the containing form.

The attached solution contains a "TestHarness" project that includes most of the implementations of the control. Also, there is a DOC directory in the attached solution that holds some documentation I started working on while developing the control. It's not complete, though.

History

17 September, 2007 -- Original version posted

26 September, 2007 -- Image added to article

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

I found your Outlook-like Control very useful.
I developed my specific object which handles a menu for a business app.
I personalize it by using only the detail section and putting there a treeview that contains all the possible calls to forms I need in the desktop area.

Thank you.

Because I somehow specialized your general purpose control, I was wondering if I can write an article on CodeProject and describe my (and obviously yours) control.

Hi I'm having a main form which is having this Navctrl.This main form is the mdicontainer.
When i click on the treeviews inside the header and detail section,i want to open the respecting forms inside the main form.

The problem which i face now is,on first select,it is returning the selected node as null and second time,if i click on the same treenode,it is returning the value.
Any idea about this problem?

My requirement is on clicking the tree node,respective forms should get loaded in the main window[in which this navctl is placed.
Kindly help.Itz urgent.

All,
I apologize for the lengthy download but I included a word doc that I started writing and never actual finished. Also, the control is not thread safe.

Also, the idea behind the control is that you can add your own designed control surface and not just the surfaces that outlook offers. Again, think of this as a tab control.
Screenshots are available at the link below

All,
I apologize for the lengthy download but I included a word doc that I started writing and never actual finished. Also, the control is not thread safe.

Also, the idea behind the control is that you can add your own designed control surface and not just the surfaces that outlook offers. Again, think of this as a tab control.
Screenshots are available at the link below