467,868 Members | 1,295 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,868 developers. It's quick & easy.

How best to create a complex interface

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
Dec 13 '07 #1
  • viewed: 1827
Share:
3 Replies


"Malenfant" wrote:
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.

Dec 13 '07 #2
This may save you a lot of time and point you in the right direction:

http://www.codeproject.com/KB/miscct...&select=947349



"Malenfant" <ca*************@gmail.comwrote in message
news:4a**********************************@e25g2000 prg.googlegroups.com...
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

Dec 13 '07 #3
On Thu, 13 Dec 2007 05:21:23 -0800 (PST), Malenfant
<ca*************@gmail.comwrote:
>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
Dec 13 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

48 posts views Thread by Bulba! | last post: by
16 posts views Thread by D Witherspoon | last post: by
136 posts views Thread by Matt Kruse | last post: by
8 posts views Thread by Support | last post: by
4 posts views Thread by Tarun Mistry | last post: by
2 posts views Thread by Steve Le Monnier | last post: by
4 posts views Thread by =?Utf-8?B?bW9mbGFoZXJ0eQ==?= | last post: by
2 posts views Thread by =?Utf-8?B?RWl0YW4=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.