Reputation: 181
I'm building treeview programmatically, and getting information about each clicked node from a remote server. Each node has a unique key.
SForm.PosTreeView.Nodes.Add("Key1", "Vegetables")
SForm.PosTreeView.Nodes.Add("Key2", "Fruits")
SForm.PosTreeView.Nodes("Key2").Nodes.Add("Key3", "Pineapple")
Question: How to get the key of clicked node? E.g. get Key3 after clicking on "Pineapple".
Any help will be appreciated. Thanks.
Upvotes: 0
Views: 5953
Reputation: 181
Node.Name - that's what i needed.
Private Sub PosTreeView_AfterSelect(sender As Object, e As TreeViewEventArgs)
Handles PosTreeView.AfterSelect
Console.WriteLine(e.Node.Name)
End Sub
Upvotes: 3