Member Avatar for hueikar

Good morning, All

I am going to place the tag propeties at each node. And the tag content will be file path.

But my coding is not working..Can someone help me..

Thnx.

My code to generate treenode tag properties from xml is as below:

Private Sub AddTreeViewChildNodes(ByVal parent_nodes As TreeNodeCollection, ByVal xml_node As XmlNode)
        For Each child_node As XmlNode In xml_node.ChildNodes
            Dim new_node As TreeNode = parent_nodes.Add(child_node.Name)
            'set your tag here
            new_node.Tag = child_node.Attributes("Tag")
            AddTreeViewChildNodes(new_node.Nodes, child_node)
            If new_node.Nodes.Count = 0 Then new_node.EnsureVisible()
        Next child_node
    End Sub

My xml file is like this :
<Items>
<IT>
<HR Tag="C:\Users\Desktop\IT.txt"><HR>
<Engineer>
<LP />
<List />
</Engineer>
</IT>
</Items>

On line 3 try:

Dim new_node As TreeNode 
new_node = parent_nodes.Add(child_node.Name)
Member Avatar for hueikar

Thnx for ur reply. It didnt work..
Btw. i had solve it ady. Thnx.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.