Start New Discussion within our Software Development Community

hi,i m making a windows forms application and i want to make a treeview which displays input of textbox Under the Parent Node .
i have tried searching over the internet,but nothing seems to be working.
i have added the parent nodes from the properties tab,but how do i change the values of child nodes or add new ones under specific parent nodes?

i have tried these codes but none of these work!

// treeView1->Nodes->(textBox1->Text,1);

			// TreeNode n;

			// n.Nodes->Add(textBox1->Text);

			 //treeView1->Nodes->TreeView1->Items->Item[0], "Europe");

			 /* TreeNode node;
            
		    node = treeView1->Nodes->Add("Fruits");
            node.Nodes->Add("Apple");
            node.Nodes->Add("Peach");
            
            node = treeView1->Nodes->Add("Vegetables");
            node.Nodes->Add("Tomato");
            node.Nodes->Add("Eggplant");*/

p.s The Syntax of Visual C++ 2008 is also different,i guess.

any help would be greatly appreciated!
thanks

i found it myself!
after a day of searching!
i am putting the code here for anybody else who might encounter this problem!

private: System::Void Form1_Load(System::Object *  sender, System::EventArgs *  e)
{
	 TreeNode* ParentNode1;
	 TreeNode* ParentNode2;

	 ParentNode1 = treeView1->Nodes->Add("tv1");
	 ParentNode1->Nodes->Add("tv1FirstChild");
	 ParentNode1->Nodes->Add("tv1SecondChild");
	 ParentNode1->Nodes->Add("tv1ThirdChild");
	 ParentNode1->Nodes->Add("tv1FourthChild");
	 ParentNode1->Expand();

	 ParentNode2 = treeView2->Nodes->Add("tv2");
	 ParentNode2->Nodes->Add("tv2FirstChild");
	 ParentNode2->Nodes->Add("tv2SecondChild");
	 ParentNode2->Expand();
}
This question has already been answered. Start a new discussion instead.