Results 1 to 3 of 3

Thread: VB - How to show "open folder" and "closed folders" in a TreeView

  1. #1

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    VB - How to show "open folder" and "closed folders" in a TreeView

    The attached project demonstrates how to have a Treeview control display "open folder" and "closed folder" icons.
    Attached Files Attached Files

  2. #2
    Member
    Join Date
    Jul 2005
    Posts
    35

    Re: VB - How to show "open folder" and "closed folders" in a TreeView

    can you explain how can i put code that lets say once you click on the "another" folder a msgbox popsup

  3. #3
    New Member snaffles's Avatar
    Join Date
    Aug 2005
    Location
    Dark side of the moon
    Posts
    1

    Lightbulb Re: VB - How to show "open folder" and "closed folders" in a TreeView

    Hi there fella,

    here's how I done it.... Open the Treeview Zip attachment that was posted at the top of this thread by MartinLiss, and open the project.

    Then add the code below to the bottom of the treeview form source code.

    It checks each node that is double clicked to see if the text for that node is "another". If the text matches, then it throws up the message box at you.

    VB Code:
    1. Private Sub JUMP()
    2. MsgBox "You selected the " & Chr(34) & "another" & Chr(34) & " folder", vbInformation, "Another Selection" 'Popup a message box.
    3. End Sub
    4.  
    5. Private Sub tvwDemo_DblClick()
    6.     If tvwDemo.SelectedItem.Text = "another" Then
    7.         JUMP    'Call the JUMP Sub, containing the message box.
    8.     End If
    9. End Sub


    There are other ways of doing it ... with indexes and stuff... but I found this to be the easiest method.

    Hope it's of some help to you.

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