TreeNode with Image List

  • Thread starter Thread starter A-PK
  • Start date Start date
A

A-PK

Hi All,

I browse through the msdn.microsoft.com and was able to fine one article
related to Treeview ImageList.

my coding is like the following

Dim rootNode as New TreeNode

rootNode = TreeView1.Nodes.Add("Parent Node")

Dim nodeFirstChild = New TreeNode("FirstChildNode", 1, 2)

nodeFirstChild = rootNode.Nodes.Add(nodeFrist)

' When I tried to add Second Child Node, i will encounter the problem, so I
dun know what to continue. Hope someone could guide me. I was thinking to
code as following for Second Child Node

Dim nodeSecond = New TreeNode("SecondChildNode", 2 , 3)

nodeSecond = nodeFirstChild.Nodes.Add(nodeSecond)

Here, Having problem, but I am only Dim node = new TreeNode ( with out the
imagelist after TreeView ), then everything is working fine. Pls guide
me....



Thank you very much



Regards

Pierce
 
A-PK said:
Dim rootNode as New TreeNode

rootNode = TreeView1.Nodes.Add("Parent Node")

Dim nodeFirstChild = New TreeNode("FirstChildNode", 1, 2)

nodeFirstChild = rootNode.Nodes.Add(nodeFrist)

' When I tried to add Second Child Node, i will encounter the problem, so
I dun know what to continue. Hope someone could guide me. I was thinking
to code as following for Second Child Node

Dim nodeSecond = New TreeNode("SecondChildNode", 2 , 3)

nodeSecond = nodeFirstChild.Nodes.Add(nodeSecond)

Here, Having problem, but I am only Dim node = new TreeNode ( with out the
imagelist after TreeView ), then everything is working fine. Pls guide
me....


The first thing you should probably do is to add Option Explicit On and
Option Strict On at the top of your code files.

What is the error message that you are receiving when you try and call that
nodeSecond line?
 
Back
Top