Hai All,
i am doing a VB.NET Windows Application. In this i am using a TreeView Control . After filling some text boxes and click Add button it should add one node and that node should me seen selected. How i can do the coding for this ?the code that i did is ...
i am doing a VB.NET Windows Application. In this i am using a TreeView Control . After filling some text boxes and click Add button it should add one node and that node should me seen selected. How i can do the coding for this ?the code that i did is ...
Dim nod As New TreeNode
nod.Text = "CS"
tVwCStr.Nodes.Add(nod)
tVwCStr.SelectedNode = nod
This code adds one node to the treeview . But selection is not working. thats that node is not seen selected even after adding the code statement tVwCStr.SelectedNode = nod. How i can make it selected . plz help ..

Habeba Khaled33 reputationPosted Aug 6, 2008, 1:44 AM EDT
You just have to set the the focus on ur tree
tVwCStr.Focus()
// Focus() in c# I don't know what's the equivelant in vb, may be SetFocus()
Done !
oc A28 reputationPosted Aug 6, 2008, 3:12 AM EDT
Thanks a lot Habeba... its working fine. In VB.NET also it is Focus().. Expecting more help from you in future also . Once again Thanks
Habeba Khaled33 reputationPosted Aug 6, 2008, 4:00 AM EDT
U r welcome oc A
wish u good luck
:)