To specified a node in Treeview on click
Loop through all the computers and add them to the treeview
If ServerList.Init Then
Dim rt As Node
Dim ch As Node
Dim strServer As String
Dim t
Set rt = TreeView1.Nodes.Add(, , , "Sistem Kawalan Makmal")
For intIDX = 1 To UBound(ServerList.List)
strServer = ServerList.List(intIDX).ServerName
t = strServer & intIDX
Set ch = TreeView1.Nodes.Add(rt, tvwChild, t, strServer)
rt.Expanded = True
Next
End If
The above is my treeview to display computers connected to the network. Now i would like to find out the code to enable me to specified the name of the particular computer when i click on its name in the treeview. Please help me this is very urgent and important to me.. Thanks alot
Re: To specified a node in Treeview on click
Quote:
Originally Posted by tauhu82
Now i would like to find out the code to enable me to specified the name of the particular computer when i click on its name in the treeview.
This makes little sense but I think I know what you mean, you want to click on an item in the treeview and get the text of it, to do something with it. For example this would add the text of the treeview item to a textbox when you click the treeview item...
VB Code:
Text1.Text = TreeView1.SelectedItem.Text