|
-
Feb 18th, 2006, 10:36 AM
#1
Thread Starter
Member
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
-
Feb 18th, 2006, 11:59 AM
#2
Re: To specified a node in Treeview on click
 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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|