Re: Treeview help
- From: "Bob Butler" <tiredofit@xxxxxxxxxx>
- Date: Mon, 26 Dec 2005 06:43:40 -0800
"MikeD" <nobody@xxxxxxxxxxx> wrote in message
news:edWVYgcCGHA.2336@xxxxxxxxxxxxxxxxxxxx
> "Bob Butler" <tiredofit@xxxxxxxxxx> wrote in message
> news:eFOAA7bCGHA.2036@xxxxxxxxxxxxxxxxxxxxxxx
>> "MikeD" <nobody@xxxxxxxxxxx> wrote in message
>> news:OsqnrfbCGHA.3920@xxxxxxxxxxxxxxxxxxxx
>>> <Fern G> wrote in message
>>> news:ubx6w6WCGHA.916@xxxxxxxxxxxxxxxxxxxxxxx Set mynod =
>>> TreeView1.Nodes.Add(mynod.Key, tvwChild, s1(i), s1(i))
>>
>> As an aside... the first argument is a reference to the parent. You
>> can pass a key and the control will do a lookup to find the mode but
>> since you already have the reference it's simpler just to use it:
>> Set mynod = TreeView1.Nodes.Add(mynod, tvwChild, s1(i), s1(i))
>
> I didn't know you could pass a reference to a Node object for the
> first parameter. I thought it had to be an index or a key (IOW, an
> integer or a string). I wonder.....would a reference to a Node object
> get passed....or would the default property of the Node object get
> passed (which I believe is the Text property)? In any case, I don't
> think passing a Node object is a good idea. If nothing else, there's
> uncertainty (IMO) of what's actually getting passed. Is it a
> reference to a Node or is it the default property of the Node object?
The parameter is defined 'as variant' so what gets passed is the node
reference. I can't see the control determining that it has the reference
and so getting the key to look up the reference again but I guess stranger
things have happened. Unless it can be demonstrated otherwise I'd hold that
passing the reference is the better option.
--
Reply to the group so all can participate
VB.Net: "Fool me once..."
.
- 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
- Re: Treeview help
- From: MikeD
- Re: Treeview help
- From: Bob Butler
- Re: Treeview help
- From: MikeD
- Treeview help
- Prev by Date: Re: Parent folder from file
- Next by Date: Re: Parent folder from file
- Previous by thread: Re: Treeview help
- Next by thread: Re: Locking columns
- Index(es):
Relevant Pages
|