Suggestions for Large Files Using Tabs

  • Thread starter Thread starter Randy
  • Start date Start date
R

Randy

I'm writing an application where the user interface has many tabs, and sets
of tabs within each tab (customer requirement). Each subtab has a great
number of it's own controls and functions. Rather than have one enormous C#
source file, does anyone have a suggestion on how to setup an individual
source file for each tab?
 
I'm writing an application where the user interface has many tabs, and
sets
of tabs within each tab (customer requirement). Each subtab has a great
number of it's own controls and functions. Rather than have one enormous C#
source file, does anyone have a suggestion on how to setup an individual
source file for each tab?

If I follow you correctly, you can just declare a base tab class and have it
contain a collection of child tabs?

public abstract class MyTabBase
{
private MyTabBaseCollection children = new
MyTabBaseCollection();

...
}

Have each tab & sub-tab inherit this, allowing new tab pages to be written
as new class objects (in their own file). Finally inserting the correct
children into the correct parent?

n!
 
Many thanks for the response. I've been looking at this for a bit, trying to
figure out the details of what you said (which sounds like it's going in the
right direction).

At the beginning, I have a Form1 Windows application. How do I link:

private System.Windows.Forms.TabControl tabControl1;

in Form1 to the public abstract class MyTabBase?

Also, I assume that MyTabBaseCollection contains some sort of array that
holds the details of each tab page. Is that what you were thinking?

Thanks again,
Randy
 
This is just a guess but how about something like a class that implements
the TabControl class?

ie

public class someName : System.Windows.Forms.TabControl {
}

Many thanks for the response. I've been looking at this for a bit, trying to
figure out the details of what you said (which sounds like it's going in the
right direction).

At the beginning, I have a Form1 Windows application. How do I link:

private System.Windows.Forms.TabControl tabControl1;

in Form1 to the public abstract class MyTabBase?

Also, I assume that MyTabBaseCollection contains some sort of array that
holds the details of each tab page. Is that what you were thinking?

Thanks again,
Randy
 
Randy said:
does anyone have a suggestion on
how to setup an individual source file for each tab?

Why not just develop the contents of each tab as a UserControl. Then you
can leave the TabControl on your main form and simply drop the
appropriate UI onto the corresponding tab.

It's simple and gives you the loose coupling you're after.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
 
Back
Top