Re: Treeview help
- From: "MikeD" <nobody@xxxxxxxxxxx>
- Date: Sun, 25 Dec 2005 19:33:32 -0500
<Fern G> wrote in message news:e$bxhVPCGHA.1312@xxxxxxxxxxxxxxxxxxxxxxx
> Mike, thank you,
>
> there is a lot to absorb in what you posted. Can I just ask you something
> quickly before I read your post? In vb.net it's possible to get a nodes
> collection from a node like this
>
> nodes= node.nodes
>
> Is this possible also in VB6.
No. In VB6's Treeview, there's only one Nodes collection, a reference to
which is obtained from the Nodes property of the Treeview control itself. In
VB.NET, each TreeNode object has its own TreeNodeCollection. I supposed you
could write a wrapper class for VB6's Treeview to provide this
functionality, though.
>
> The problem as I see it is that initially I have the root collection, i.e.
> treeview1.
> Then, I need to add by key reference a new root node, and then obtain that
> node's collection, and so on. Is this the correct approad?
No. As I said, there's only *one* Nodes collection. It includes ALL Node
objects for the entire Treeview control. There are several properties for
getting references to related Node objects. Look up the Child, FirstSibling,
LastSibling, Next, Previous, Parent, and Root properties of a Node object.
All of these return a reference to some other Node object.
It sounds like you're coming from a VB.NET background. You need to quit
thinking in VB.NET terms when working in VB6. <g>
> o.k. now I am going to read your post
You probably should have read it and tried the sample code first. It might
have answered your questions.
--
Mike
Microsoft MVP Visual Basic
.
- References:
- Treeview help
- From: Fern G
- Re: Treeview help
- From: MikeD
- Re: Treeview help
- From: Fern G
- Re: Treeview help
- From: MikeD
- Re: Treeview help
- From: Fern G
- Treeview help
- Prev by Date: Re: Get recent time/date
- Next by Date: Re: Treeview help
- Previous by thread: Re: Treeview help
- Next by thread: Re: Treeview help
- Index(es):
Relevant Pages
|