troubleshooting Question

WinForms Tabbed Interface configured as Tree of Tabs

Avatar of deleyd
deleydFlag for United States of America asked on
.NET ProgrammingC#
7 Comments1 Solution17 ViewsLast Modified:
I have a WinForms project where the Form has a bunch of tabs configured something like this:
Here the user has selected "tabPage1", and within that TabPage they selected "tabPage4", and within that TabPage they selected "tabPgae12".

Now I want a textBox at the bottom that displays which innermost tab has been selected. (i.e. tabPage12 in the image above.)

I'm thinking the tabs really form a tree like structure:
I'm wondering if I should somehow place the tabs in a tree like data structure. Would that help me figure out which tab is the selected in the tree?

WinForms (at least as this project is currently configured) doesn't seem to have nice separation of View. Is there a design pattern that will give us better separation of View for WinForms?

Is there a clean way to design this program?

Currently it seems like I would have to manually sift through all the tabs, figure out which tab {1,2} is selected, then based on that figure out which tab {3,4,5} is selected, then based on that figure out which tab {10,11,12,13} is selected. Crawling through the View like that seems tedious and wrong. Is there a better way the TextBox at the bottom can figure out which tab is selected and display that number?

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros