There is:
- UserControl_1;
- UserControl_2;
How to make that when moving through the nodes of the tree, depending on the selected node, in "panel1" displayed "UserControl_1" or "UserControl_2"?
I did as shown in the code below.
Will it be right?
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { string name = e.Node.Text; switch (name) { case "Node_1": UserCntrl_1 userCntrl_1 = new UserCntrl_1(); panel1.Controls.Clear(); panel1.Controls.Add(userCntrl_1); break; case "Node_2": UserCntrl_2 userCntrl_2 = new UserCntrl_2(); panel1.Controls.Clear(); panel1.Controls.Add(userCntrl_2); break; } } 
Visibleproperty, but you can. Internal processes to bind to the state propertiesVisible(true / false) orParent(null /! Null), something like that. But in general, the processes should not be nailed to the control, they have a place in the model layer, and let the control reflect to itself the state and does not do unnecessary things. - rdorn