471,854 Members | 1,559 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,854 software developers and data experts.

Accessing/Setting Custom Properties in a Custom TreeNode

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
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."

Read the property in the AfterSelect event:

Dim myCustomTreeNode as New CustomTreeNode
myCustomTreeNode = CType(e.Node, CustomTreeNode)

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?


Nov 21 '05 #1
0 2517

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Jason Butera | last post: by
6 posts views Thread by Angel | last post: by
reply views Thread by NeoPa | last post: by
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.