Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am completely new to C#. I have created a SplitContainer that has a tree view on the left and a pane on the right. I want the contents of the right-hand pane to change depending on what is clicked in the tree-view. So there will be different widgets in the right-hand pane depending on the tree-view item that was clicked.

What is the best way to achieve this? Is it possible to design the layouts of the different right-hand pane contents using the toolbox and drag-and-dropping widgets onto a container (but I don't want it to be on a different form), or does it have to all be done in the code. Are there any examples of this - I havn't found any yet.

Mnay thanks
Posted

1 solution

In code is the way forward...

Have a look at this video ... http://www.youtube.com/watch?v=8JkbQY93xYY[^]

Microsoft blurb is here[^]

Lots more examples by google search dynamically load controls at runtime c# "

Most of the examples I've seen just put the controls onto the form - you will need to add them to the containing panel so instead of
C#
form1.Controls.Add(...
you'll use something like
C#
panel1.Controls.Add(...
 
Share this answer
 
Comments
Jackie Lloyd 6-Feb-13 6:31am    
Thanks, that's got me started :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900