J
johnb41
In my treeview, I need each node to hold a "value", not just
text/label. Kind of like how a ListBox item has text, and a value
associated with it. I need this because when a node is clicked, i need
to get the "value" behind the node and then use it do do something.
Anyway, I made a custom treenode class that inherits from Treenode, and
added a property called "value".
I was able to successfully create the Treeview programmatically from a
database, which includes the "value" property that i made.
Here's my problem: The routine I have to run when a user clicks a node
is this:
Private Sub treeview_AfterSelect(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles
treeview.AfterSelect
'do something with e.Node.value
End Sub
Because my "value" property was added in my custom class, it is not
available to use in TreeViewEventArgs. So e.Node.Value will not work.
How can I do this?...i'm stumped!
Thanks for your help!
John
text/label. Kind of like how a ListBox item has text, and a value
associated with it. I need this because when a node is clicked, i need
to get the "value" behind the node and then use it do do something.
Anyway, I made a custom treenode class that inherits from Treenode, and
added a property called "value".
I was able to successfully create the Treeview programmatically from a
database, which includes the "value" property that i made.
Here's my problem: The routine I have to run when a user clicks a node
is this:
Private Sub treeview_AfterSelect(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles
treeview.AfterSelect
'do something with e.Node.value
End Sub
Because my "value" property was added in my custom class, it is not
available to use in TreeViewEventArgs. So e.Node.Value will not work.
How can I do this?...i'm stumped!
Thanks for your help!
John