In visual basic.net (I'm actually using SharpDevelop; same code), how does one automatically select the last node added to a treeview regardless of placement?
Let's say I have several Root Nodes and I choose the middle one (say, the second root node). If I were to add a child node to the second root node, I would like it to automatically select the newly added node.
How would one accomplish this?
Sub Added Now <-I want to automatically select this because it was just added
Sub Added A Long Time Ago
Sub Button2Click(ByVal sender As Object, ByVal e As EventArgs)
Dim node as TreeNode
node = treeview1.Nodes.Add(str)
'code goes here to automatically select the node which was just added in the previous line of code.'