Click here to Skip to main content
15,791,567 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
So this is a design/structural question regarding two TabControls.

My windows form has an outer main TabControl whose TabPages will hold individual backup job information. So, for example, I may have three main tabpages:

[Backup Job 1] [Backup Job 2] [Backup Job 3]

When I click on [Backup Job 2] another TabControl and it's associated TabPages will display:

[Backup Job 1] [Backup Job 2] [Backup Job 3]
[What To Backup] [Where To Backup] [Compression] [Encryption]

The complexity here with the TabControls, is that the inner TabControl for the backup jobs may have no backup jobs, one or more, each with their own inner TabControl and associated TabPages.

So I thought I would create the outer TabControl and one inner (backup job) TabControl with it's associated TabPages and make it invisible, only to be used as a template. Such that when I clicked on the menu item create new backup job, my code could use this 'hidden' backup job TabPage and make it visible and load it's data accordingly.

But I found out you can't hide a TabPage (seems odd that you can't do that) so that idea went out the window. Am I left with creating new backup jobs by instantiating each one as needed and then setting up the display of the backup job inner TabControl, all by code?

Or is there another way that I am not aware of?

Thanks for your thoughts...
Sergey Alexandrovich Kryukov 5-Sep-13 0:15am    
If you mention, say, "TabControl", you should specify which one. Full type name, please.
rfresh 5-Sep-13 0:23am    
It's called 'TabControl', right in the toolbox of Visual Studio 2012. I don't know what other name to use.
Sergey Alexandrovich Kryukov 5-Sep-13 0:28am    
The "other name" is the type name. "TabControl" is simple name, ambiguous (isn't it obvious?). What is the fully-qualified name (with name space)?
And you should always tag the UI library or application type your use or want to use, as soon as UI is involved.

1 solution

Nested Tab Controls, as well as any other navigation controls, would greatly confuse the users, not only the beginners, but experienced once alike, because such UI design is confusing by nature.

You should review your UI design to make it more usable and readable. This is just one idea: use two different navigation control styles on outer and inner levels. For example, for one level keep the TabControl, and for other, use combined custom (or user control) based on ListBox and set of panels: as you navigate from one list element to another, you show different panel, hiding all others. Each panel would play the same role as a TabPage of a TabControl.

Besides, you can try to rethink your navigation content: is it really two-level, or is such hierarchy artificial. Maybe not, but it's important to critically look at your design.

Share this answer
rfresh 5-Sep-13 0:25am    
Hmmm...thank you for that idea...I will give it some thought...thank you...
Sergey Alexandrovich Kryukov 5-Sep-13 0:29am    
You are welcome. Will you accept the answer formally (green button)?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900