I've figured out how to create a custom TreeNode with custom properties
and I can view those properties at runtime, but I'm not sure how to
change them after I've added the custom node to the tree.
For example:
Public Class CustomTreeNode
Inherits TreeNode
Dim _CustomProperty as String
Public Property CustomProperty() As String
Get
Return Me._CustomProperty
End Get
Set(ByVal value As String)
_CustomProperty = value
End Set
End Property
End Class
Add the node to the tree:
....
Dim myCustomTreeNode as New CustomTreeNode
myCustomTreeNode.CustomProperty = "Google is great."
TreeView1.Nodes.Add(myCustomTreeNode)
....
Read the property in the AfterSelect event:
....
Dim myCustomTreeNode as New CustomTreeNode
myCustomTreeNode = CType(e.Node, CustomTreeNode)
MsgBox(myCustomTreeNode.CustomProperty)
....
Now, how to I change the value of CustomProperty?
....
Dim myCustomTreeNode as New CustomTreeNode
myCustomTreeNode.CustomProperty = "Google is really great."
TreeView1.SelectedNode = myCustomTreeNode
....
This doesn't appear to work. Any suggestions?
Bishop