treeview and mdichild
-
can someone know how to put a code on a treeview node?? where can i find the mdichild form.. there is no mdi child form on the when i clicked project then add form.. ginji
Do you mean how to create a TreeNode in code and add it to a TreeView? If so:
// This method has many options - check MSDN
TreeNode node = new TreeNode("Node Text");
treeView1.Nodes.Add(node);MDI children are just normal forms which is why there's no automatic MDIChildForm option. Set the parent form's IsMdiContainer property to true, and after you instanciate the child form, set it's MdiParent property to the parent form. i.e.
Form2 form2 = new Form2();
form2.MdiParent = this;
form2.Show();Dave
-
Do you mean how to create a TreeNode in code and add it to a TreeView? If so:
// This method has many options - check MSDN
TreeNode node = new TreeNode("Node Text");
treeView1.Nodes.Add(node);MDI children are just normal forms which is why there's no automatic MDIChildForm option. Set the parent form's IsMdiContainer property to true, and after you instanciate the child form, set it's MdiParent property to the parent form. i.e.
Form2 form2 = new Form2();
form2.MdiParent = this;
form2.Show();Dave
i mean how to put a code in a node for example if i click node1 another form opens then if i click node2 the form is disabled... mdichild thanks i created a mdi child form can i also how can i close the mdichild form and goes back to the mdiparent because if i hide the mdichild the mdiparent also hides.
modified on Wednesday, June 25, 2008 9:27 PM