Click here to Skip to main content
13,195,026 members (96,865 online)
Click here to Skip to main content
Add your own
alternative version


54 bookmarked
Posted 17 Sep 2007

An Outlook-like Control

, 17 Sep 2007
Rate this:
Please Sign up or sign in to vote.
Creating a tab control with visual cues like the navigation panel control in Outlook


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.

Screenshot - NavCtl.jpg

How to Use the Control

  1. 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
  2. Set a reference to NavCtl.dll in your project.
  3. Add the control to your toolbox. To do this, right click on the toolbox and click "Choose Items."
  4. In the "Choose Toolbox Items" dialog box, click "Browse..." and find NavCtl.dll. Alternatively...
  5. Once selected, the controls AdrdNC and TabC will be added to your toolbox active tab.
  6. Drag and drop the control on any form.
  7. Now add a new user control to your project. This user control must visually inherit from the HDCControl as in the next two figures.
  8. Design your user control by adding other controls to it.
  9. In your code view of the containing form, create a locally scoped variable of type AdrdNavigationTabCollection. The following is a code example.
    public partial class Form1 : Form
        AdrdNavigationTabCollection TabsCollection = 
            new AdrdNavigationTabCollection();
  10. In the form Load event, create a variable of type AdrdNavigationTab.
    AdrdNavigationTab tab = new AdrdNavigationTab();
  11. Assign the user control you created in steps 7 and 8 to the AdrdNavigationTab variable HeaderControl and DetailControl properties.
    tab.HeaderControl = new YOURCONTROL();
    tab.DetailControl = new YOURCONTROL ();

    Note: replace "YOURCONTROL" with your user control name.

  12. Add the instant of AdrdNavigationTab you created in step 10 to the collection you created in step 9.
  13. Assign the instant of the collection AdrdNavigationTabCollection to the AllTabsCollection property of the control.
    this.adrdNC1.AllTabsCollection = TabsCollection;
  14. (OPTIONAL) Create the OnTabAction and OnChildClick handlers.
    this.adrdNC1.OnTabAction += new TabActions(adrdNC1_OnTabAction);
    this.adrdNC1.OnChildClick += new 

Important Steps

  1. Make sure all your user controls (tabs) inherit from HDCControl.
    public partial class YOURCONTROL : HDCUserControl.HDCControl
  2. 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:
      void tv_AfterSelect(object sender, 
          System.Windows.Forms.TreeViewEventArgs e)
          OnAction(this, "Node selection Changed");
    • In your container form, code the AdrdNC control OnTabAction event.
  3. 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.


  • 17 September, 2007 -- Original version posted
  • 26 September, 2007 -- Image added to article


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.

A list of licenses authors might use can be found here


About the Author

Systems Engineer Time Warner Cable
United States United States
Adel Eddin is a software architect evangelist with extensive experience in planning, developing, and implementing large information technology solutions in the financial and public sectors.

You may also be interested in...


Comments and Discussions

GeneralMy vote of 1 Pin
Mukesh_B22-Jul-10 23:22
memberMukesh_B22-Jul-10 23:22 
GeneralMy vote of 1 Pin
The Code Guru18-Dec-08 0:21
memberThe Code Guru18-Dec-08 0:21 
GeneralHi Mr Adel Pin
ItalianCousin26-Nov-08 7:29
memberItalianCousin26-Nov-08 7:29 
QuestionTreeview inside the header and details section of Navctrl Pin
AlwaysACreator17-Jun-08 5:04
memberAlwaysACreator17-Jun-08 5:04 
GeneralPerformance Pin
Patrick Sears17-Sep-07 9:58
memberPatrick Sears17-Sep-07 9:58 
GeneralRe: Performance Pin
Ed.Poore17-Sep-07 11:04
memberEd.Poore17-Sep-07 11:04 
GeneralRe: Performance Pin
Patrick Sears17-Sep-07 11:18
memberPatrick Sears17-Sep-07 11:18 
GeneralRe: Performance Pin
Ed.Poore17-Sep-07 12:42
memberEd.Poore17-Sep-07 12:42 
GeneralRe: Performance Pin
adel s eddin at adrdweb.com17-Sep-07 14:58
memberadel s eddin at adrdweb.com17-Sep-07 14:58 
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


GeneralScreenshot would be nice Pin
Ed.Poore17-Sep-07 8:48
memberEd.Poore17-Sep-07 8:48 
GeneralRe: Screenshot would be nice Pin
joaoalbertofn17-Sep-07 8:56
memberjoaoalbertofn17-Sep-07 8:56 
GeneralRe: Screenshot would be nice Pin
Luke Searcy17-Sep-07 9:00
memberLuke Searcy17-Sep-07 9:00 
GeneralRe: Screenshot would be nice Pin
Patrick Sears17-Sep-07 9:40
memberPatrick Sears17-Sep-07 9:40 
JokeRe: Screenshot would be nice Pin
Grimolfr17-Sep-07 9:53
memberGrimolfr17-Sep-07 9:53 
GeneralRe: Screenshot would be nice Pin
adrdweb.com17-Sep-07 14:28
memberadrdweb.com17-Sep-07 14:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171018.2 | Last Updated 17 Sep 2007
Article Copyright 2007 by AdelArch
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid