|
-
Aug 17th, 2001, 04:44 AM
#1
finding all parent nodes in a treeview
I am trying to find all the parent nodes.
I have been trying the following with the parent property, but it says that it is nothing, any suggestions????
for intIndex = 1 To Journey_Tree1.Nodes.Count
Set nodTmp = Journey_Tree1.Nodes.Item(ind)
If nodTmp.Parent Then
strTmpKey = Journey_Tree1.Nodes(ind).key
end if
next
-
Aug 17th, 2001, 05:04 AM
#2
Addicted Member
try using "If nodTmp.Parent Is Nothing Then"
instead of "If nodTmp.Parent Then "
hth.
-
Aug 17th, 2001, 05:20 AM
#3
Junior Member
you can try also
for i = 1 to mytreeview.nodes.count
if mytreeview.nodes(i).children > 0 then
msgbox "this is a parent node"
end if
next
 Thoms 
-
Aug 17th, 2001, 05:21 AM
#4
thanks for that but i get an Invalid use of object when i put NOT.
For ind = 1 To Journey_Tree1.Nodes.Count
Set nodTmp = Journey_Tree1.Nodes.Item(ind)
If nodTmp.Parent Is Not Nothing Then
any other suggestions???
-
Aug 17th, 2001, 05:28 AM
#5
i just made this mistake in the thread below 
VB Code:
If Not (nodTmp.Parent Is Nothing) Then
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
|