Don't worry - this will probably be the last question from me about them. ;-)
How do I go about closing all the nodes/threads in a TreeView which the user has just opened?
I thought it would've been .Refresh but it didn't do it.
-Git
Printable View
Don't worry - this will probably be the last question from me about them. ;-)
How do I go about closing all the nodes/threads in a TreeView which the user has just opened?
I thought it would've been .Refresh but it didn't do it.
-Git
Oh no! I had to go to the Components window! (OH THE HORROR!)
Don't worry: I'll get over it. :rolleyes:
Code:Private Sub Command1_Click()
Dim Node As Node
For Each Node In TheNameOfTheTreeviewControlOnTheFormInYourProjectGoesHere.Nodes
Node.Expanded = False
Next
End Sub
Code:Option Explicit
Private Sub Command1_Click()
Dim i As Long
For i = 1 To TreeView1.Nodes.Count
TreeView1.Nodes.Item(i).Expanded = False
Next
End Sub
Code:Private Sub TreeView1_Expand(ByVal Node As MSComctlLib.Node)
Node.Expanded = False
End Sub
he wants them to be collapsed after a certain period of time or something like that(I think) I dont think he wants to disable expansion all together.
Oh, i thought that was what he wanted with "which the user has just opened"
I tried Yonatan's code and it worked straight off how I wanted. Thanks for all you guy's help - I think I've finally finished work on this TreeView... :-)
Cyas.
-Git