Ken H

Ken H

  • NA
  • 646
  • 361.7k

How to add icon picture in treeView nodes?

Dec 3 2014 2:25 AM
Hi all,
   I need in the left of each node add ico picture.
 
The pictures in which the parent node as "folder" pictures,
when you expand the node "folder" the priture for open status.
when you close the node "folder" the picture for closed status.
 
 
My codes:
 
private void Form1_Load(object sender, EventArgs e)
{
treeView1.Nodes.Add("Books");
treeView1.Nodes[0].Nodes.Add("Computer");
treeView1.Nodes[0].Nodes[0].Nodes.Add("C++ Programming");
treeView1.Nodes[0].Nodes[0].Nodes.Add("C# Programming");
treeView1.Nodes[0].Nodes[0].Nodes.Add("Data Structure");
treeView1.Nodes[0].Nodes.Add("Language");
treeView1.Nodes[0].Nodes[1].Nodes.Add("English Tutorial");
treeView1.Nodes[0].Nodes.Add("Math");
treeView1.Nodes[0].Nodes[2].Nodes.Add("Discrete Mathematics");
treeView1.Nodes[0].Nodes[2].Nodes.Add("Advanced Mathematics");
treeView1.Nodes[0].Nodes[2].Nodes.Add("Number Theory");
}
 
Thanks.
 

Answers (1)