|
-
Aug 18th, 2000, 02:31 AM
#1
Thread Starter
Addicted Member
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
-
Aug 18th, 2000, 02:36 AM
#2
Guru
Oh no! I had to go to the Components window! (OH THE HORROR!)
Don't worry: I'll get over it. 
Code:
Private Sub Command1_Click()
Dim Node As Node
For Each Node In TheNameOfTheTreeviewControlOnTheFormInYourProjectGoesHere.Nodes
Node.Expanded = False
Next
End Sub
-
Aug 18th, 2000, 02:37 AM
#3
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
-
Aug 18th, 2000, 02:43 AM
#4
transcendental analytic
Code:
Private Sub TreeView1_Expand(ByVal Node As MSComctlLib.Node)
Node.Expanded = False
End Sub
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 18th, 2000, 02:48 AM
#5
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.
-
Aug 18th, 2000, 03:00 AM
#6
transcendental analytic
Oh, i thought that was what he wanted with "which the user has just opened"
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 18th, 2000, 03:03 AM
#7
Thread Starter
Addicted Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|