On Jun 25, 7:58 pm, Mark <M...@discussions.microsoft.comwrote:
In Visual Basic 2008 how do I programmatically set a node to selected?
For example, my treeview has several nodes with dates, and I want set one
of the dates as selected because it happens to match a date variable.
How would I go about this?
Thanks for any help!
Mark
Hi,
Your treeview may also need to get focus before seeing target node as
selected. For example if you want a node to see selected after a
button click you can use the syntax as:
/////////////////
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
TreeView1.Focus()
' SelectedNode property does the trick
TreeView1.SelectedNode = TreeView1.Nodes.Item("node_name")
End Sub
\\\\\\\\\\\\\\\\
Hope this helps,
Onur Güzel