How best to create a complex interface

M

Malenfant

I'm currently working on my first relatively complex C# application
and I've run into some problems as to the best way to develop the
interface. The design spec calls for a treeview on the left-hand side
which brings up the relevant interface when the node is clicked on. I
made some initial headway by storing the interface information in
separate forms and then loading the controls onto the main form like
this:

this.blankPanel.Controls.Clear();
if (e.Node.Text == "Billing Runs")
{
billingRunMain billingrunForm = new billingRunMain();
foreach (Control c in billingrunForm.Controls)
this.blankPanel.Controls.Add(c);
billingrunForm.Dispose();
}

This worked fairly well but I've run into some major limitations,
mainly that accessing those controls once they have been added is
seemingly impossible. I can configure them before putting them on the
main form but I've now run into my first control that needs to be
updated after been loaded onto the form.

I've tried Panels and Tab controls but both have problems. The panels
are seemingly impossible to maintain as each panel must be stacked on
top of each other in the IDE. The tab control is also problematic, as
I can't find a way to hide the tabs or ensure that the user can't
switch to the wrong tab.

I'm sure there must be another solution I'm missing here and any help
would be greatly appreciated.

Regards,

Steve Green
 
F

Family Tree Mike

Malenfant said:
I'm currently working on my first relatively complex C# application
and I've run into some problems as to the best way to develop the
interface. The design spec calls for a treeview on the left-hand side
which brings up the relevant interface when the node is clicked on. I
made some initial headway by storing the interface information in
separate forms and then loading the controls onto the main form like
this:

this.blankPanel.Controls.Clear();
if (e.Node.Text == "Billing Runs")
{
billingRunMain billingrunForm = new billingRunMain();
foreach (Control c in billingrunForm.Controls)
this.blankPanel.Controls.Add(c);
billingrunForm.Dispose();
}

This worked fairly well but I've run into some major limitations,
mainly that accessing those controls once they have been added is
seemingly impossible. I can configure them before putting them on the
main form but I've now run into my first control that needs to be
updated after been loaded onto the form.

I've tried Panels and Tab controls but both have problems. The panels
are seemingly impossible to maintain as each panel must be stacked on
top of each other in the IDE. The tab control is also problematic, as
I can't find a way to hide the tabs or ensure that the user can't
switch to the wrong tab.

I'm sure there must be another solution I'm missing here and any help
would be greatly appreciated.

Regards,

Steve Green

It sounds like you should be creating a user control called (perhaps)
BillingRunControl. You create a new instance of that control and add it to
the window.
 
B

bob clegg

I'm currently working on my first relatively complex C# application
and I've run into some problems as to the best way to develop the
interface. The design spec calls for a treeview on the left-hand side
which brings up the relevant interface when the node is clicked on. I
made some initial headway by storing the interface information in
separate forms and then loading the controls onto the main form like
this:

this.blankPanel.Controls.Clear();
if (e.Node.Text == "Billing Runs")
{
billingRunMain billingrunForm = new billingRunMain();
foreach (Control c in billingrunForm.Controls)
this.blankPanel.Controls.Add(c);
billingrunForm.Dispose();
}

This worked fairly well but I've run into some major limitations,
mainly that accessing those controls once they have been added is
seemingly impossible. I can configure them before putting them on the
main form but I've now run into my first control that needs to be
updated after been loaded onto the form.

I've tried Panels and Tab controls but both have problems. The panels
are seemingly impossible to maintain as each panel must be stacked on
top of each other in the IDE. The tab control is also problematic, as
I can't find a way to hide the tabs or ensure that the user can't
switch to the wrong tab.

I'm sure there must be another solution I'm missing here and any help
would be greatly appreciated.

Regards,

Steve Green
Hi Steve,
I don't know whether this is a correct take on your problem but ...
It sounds like your other forms are generating information. You are
then trying to display this information on your master form.

A couple of approaches may work in this scenario.

1) If the generating forms are writing their efforts to a database,
they can raise an event to say that data is ready to be picked up and
your masterform can pick it up from the database.

2) If the data is transitory then I would lean towards passing it to
the master form via events.

Either way the point is pass data only and not windows controls.

When the data arrives you can hang it on the Tag property of a node
and add it to the tree.

regards
Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top