CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002
    Location
    Toronto
    Posts
    167

    A treeview newbie problem

    Ok I've made a treeview on my form and now and it looks like this. Using treeview1.nodes(0).add("Mike's house")
    and treeview1.nodes(0).nodes(0).add("cost")


    - Location
    - Mike's House
    cost
    time
    - Frank's House
    cost
    time

    I've added a handler that goes to a sub afterselect.click My question is, how do I know what was clicked in the tree view ?

    Is there a method to find out what the text of the node and the parent nodes is ?

    so

    x = cost
    y = Mike's House
    z = Location

    if that node was clicked ...

    Thanks ...
    Last edited by Jym; January 7th, 2003 at 12:36 PM.

  2. #2
    Join Date
    Nov 2002
    Posts
    34
    Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect

    Debug.WriteLine(TreeView1.SelectedNode.Text)

    End Sub

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

Featured