PDA

Click to See Complete Forum and Search --> : VB - How to show "open folder" and "closed folders" in a TreeView


MartinLiss
Feb 18th, 2003, 04:14 PM
The attached project demonstrates how to have a Treeview control display "open folder" and "closed folder" icons.

vbcooler
Aug 3rd, 2005, 07:58 PM
can you explain how can i put code that lets say once you click on the "another" folder a msgbox popsup

snaffles
Aug 18th, 2005, 11:26 PM
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.



Private Sub JUMP()
MsgBox "You selected the " & Chr(34) & "another" & Chr(34) & " folder", vbInformation, "Another Selection" 'Popup a message box.
End Sub

Private Sub tvwDemo_DblClick()
If tvwDemo.SelectedItem.Text = "another" Then
JUMP 'Call the JUMP Sub, containing the message box.
End If
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.