Results 1 to 2 of 2

Thread: To specified a node in Treeview on click

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    61

    Exclamation 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

  2. #2
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    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:
    1. Text1.Text = TreeView1.SelectedItem.Text
    Chris

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width