Results 1 to 3 of 3

Thread: Selecting a Treeview Node programatically

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    27

    Question Selecting a Treeview Node programatically

    Hello all,

    I have searched the web without the required information found unfortunately. Also looked on this forum to see if I could find it, but no result, so here is my question:

    I want to generate a "button1" that when you click it, it will expand a "treeview1" to (fullpath) "SelectedItem.Reports.Segments"

    Basically the button would have to do the same as clicking first on SelectedItem, then on Reports (It would show Segments)

    I looked everywhere, but no results, anyone any thoughts on how to establish this? Thanks in advance!
    *(^.^); c(_)

  2. #2
    Registered User
    Join Date
    Jul 2001
    Posts
    283
    search on the forums. the way to do it is using hashtables. there is no method inherent in vb that lets you select a treenode based on any of its preperties.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    27
    Hi hi, I'm closing this thread, found the info I needed...
    I'm just using simple code to do what I wanted:

    VB Code:
    1. Dim tn As TreeNode
    2.  
    3.         tn = tvTasks.TopNode
    4.         tvTasks.SelectedNode = tn
    5.         tn.Expand()
    6.         tn = tvTasks.SelectedNode.FirstNode.NextNode
    7.         tn.Expand()
    8.         tvTasks.SelectedNode = tn
    9.         Me.Show()

    thanks!
    *(^.^); c(_)

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