An array of panels for a configuration window

  • Thread starter Thread starter Rune Jacobsen
  • Start date Start date
R

Rune Jacobsen

Hi all again,

My application has a configuration window that is currently using a
tabcontrol to separate the different logical aspects of configuring it.
That is all well and fine, but I am soon going to have enough pages that
this will look really crowded. I decided that the most elegant solution
would be to go for a treeview where you select the category, and then
the right side of the window will display a panel that contains the
related configuration options.

Currently, we're talking about 5-10 pages of configuration settings, and
it might expand to 15-20 in the near future. What I thought of doing was
to have an array of settings, something like this in psuedo-code:

(A ConfigPage contains the Path (from the treeview), a display string
for the top right part of the window, and the panel to be displayed when
the Path node is the current one).

ConfigPage[] ConfigPages =
{
{"MyApp", "MyApp Configuration Settings", pConfigIntro},
{"MyApp\Data", "MyApp Data Settings", pDataPage},
{"MyApp\GUI", "Graphical stuff", pGUIPage}
}

You probably understand what I mean.

What I am wondering - is this the "correct" way to do it? Is there a
more elegant way? Does anyone have any experience from implementing
something like this, or any tips'n'tricks for how to make it user
friendly and painless for the developer (me) at the same time?

Also, where should I define this array for C# to not hate me? After the
VS2003-generated InitializeComponent() function perhaps?

Thanks for any input!

Rune
 
Is the crowding due to the tabs being visible?

Keep the TabControl, but use a custom one in which you can hide the tabs.
Then just use your Treeview to set the tabcontrols selectedindex.

For the modifications needed to TabControl see the example on my site titled
"Add a HideTabs property to turn on/off the Tabs"
http://www.dotnetrix.co.uk/tabcontrols.html

You could even modify the example to give you a Title Area at the top, after
first having set Alignment to bottom.
 
Back
Top