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."
- In the "Choose Toolbox Items" dialog box, click "Browse..." and find NavCtl.dll. Alternatively...
- Once selected, the controls
AdrdNC
and TabC
will be added to your toolbox active tab. - Drag and drop the control on any form.
- Now add a new user control to your project. This user control must visually inherit from the
HDCControl
as in the next two figures. - Design your user control by adding other controls to it.
- 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();
}
- In the form
Load
event, create a variable of type AdrdNavigationTab
.
AdrdNavigationTab tab = new AdrdNavigationTab();
- 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.
- Add the instant of
AdrdNavigationTab
you created in step 10 to the collection you created in step 9.
TabsCollection.Add(tab);
- Assign the instant of the collection
AdrdNavigationTabCollection
to the AllTabsCollection
property of the control.
this.adrdNC1.AllTabsCollection = TabsCollection;
- (OPTIONAL) Create the
OnTabAction
and OnChildClick
handlers.
this.adrdNC1.OnTabAction += new TabActions(adrdNC1_OnTabAction);
this.adrdNC1.OnChildClick += new
ChildControlWasClickedActions(adrdNC1_OnChildClick);
Important Steps
- Make sure all your user controls (tabs) inherit from
HDCControl
.
public partial class 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:
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
Adel has over 30 years of experience in planning, architecting, developing, and implementing state of the art information technology solutions involving SOA, Microservices, Blockchain, AI, REST, DCOM, CORBA, SSO, SAML, Low Latency, High availability, IoT, Embedded Systems, Robotics, SCADA, VOIP, and OSS Technologies. He is highly technical leader with extensive hands-on experiences that cover architecting, coding, and deployment of complex IT solutions and systems with a strong passion for “all things IT”. Adel Led large cross-functional teams with diverse technical backgrounds and designed and managed all the needed budget controls and deliverables. He is having strong knowledge of financial, medical/pharmaceutical, and industrial domains. He also is having strong Agile and CMMI processes experiences.
Mr. Eddin is known in the DevOps space as a leader in the development of DevOps operations and processes, continuous integration, continuous builds, source control, infrastructure build-outs, and cloud integrations on-premises and on the cloud.
In the last 15 years, Adel led number of large cloud technologies initiatives that that include public clouds (AZURE, AWS), private on-premises cloud (VMware vSphere), and Hybrid cloud implementations (VMware vSphere). He is also recognized as a leader in the security space. He demonstrated extensive knowledge in all aspects of IT security including, but not limited to physical security, coding security, P2PE, Ciphering, and Encryption with both hard (appliance or IOT based) and soft (software code based) implementations.
He has strong background in software development life cycle, software development management, infrastructure management, and IT software and hardware “build-outs”. He also managed multi-million-dollar IT projects that covered all corners of the globe using on-shore and off-shore resources and covering a wide range of the information technology spectrum.