Treeview and root level

Bobn
03-27-2001, 07:15 PM
What's the best way to find out at runtime if you're at the root level of a treeview control, based on TreeView1.Selecteditem after a click?

klabranche
03-28-2001, 07:40 AM
Check the Key value of the selected node against the roots Key value.

images/icons/smile.gif

Bobn
03-28-2001, 06:22 PM
If i have say 5 nodes at the root level, will the root property = the firstsibling property all the time, if i am at this level?

This is how i am determining if a node is at this root level among the 5 nodes.

klabranche
03-29-2001, 07:42 AM
You could test to see if node.Parent is nothing.... Root level objects return nothing when the parent property is called on them.

images/icons/smile.gif

Bobn
03-29-2001, 09:19 PM
Yes, I already tried this.
When node.Parent = nothing, runtime error is 91 - Object variable not set. I don't see how you can use this property when at the root level at runtime.

User2571
02-10-2003, 06:55 AM
yeah i got the exact same problem, this question dosn't seem to be answered even know it was posted in 2001

and second what with your rego bobn

Registered: Jan 1970
Location:
Posts: 17

Flyguy
02-10-2003, 07:13 AM
Is Not Node.Parent Is Nothing Then
'
End If

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum