I’m fairly new to C# programming but I’ll explain what it is I’m trying to do.
I have a windows form with a Split Container. On the left I have a tree view with several nodes which when clicked, should show a completely different view on the right hand side. For instance, there will be a Computer node which will show a list of computers and a Configuration node which will show a different type of page.
My question: is there a way to design the content of the various right hand side forms, to be swapped in dynamically when the treenode is clicked? When I say design, I mean actually using the GUI to design each type of view which could appear on the right as opposed to creating it in code.
Thanks,
Yes you can use a
UserControlthat will contain one of yourviewsfor one type of node.When a node of this type is clicked you can assign this usercontrol to the right hand side of your form.
When another node is clicked you can simply use a different usercontrol.
How this usercontrol looks can be completely designed in the WinForms GUI designer.
More information about user controls can be found on the msdn.