Setting Node Backcolor Property Value

Joined
Jun 18, 2006
Messages
23
Programming Experience
3-5
Below is my code.

VB.NET:
If reader.GetAttribute("level") = "2" Then
                        
            reader.Read()

            Dim nd As New TreeNode
            nd.Text = reader.ReadString

            reader.Read()
                        
            nd.Name = reader.ReadString
            nd.BackColor = Color.Yellow

        TreeView1.TopNode.Nodes(TreeView1.TopNode.GetNodeCount(False) - 1).Nodes.Add(nd.Name, nd.Text, 2)

End If
I do the same for "level = 1" nodes, and the color value is changed as expected.

However, when I try it on level 2 nodes, no color change is made.

I double click the parent node to expand, and the color is not changed to yellow.
 
Back
Top