Re: Treeview saga continued

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Neil (neil_at_haywood55.freeserve.co.uk)
Date: 05/18/04


Date: Tue, 18 May 2004 14:12:35 +0000 (UTC)

Dale,

The tree view control 'node click' events pass the node bing clicked into it
as an argument. From there, you can use the .Children property of this node
to count how many children the node has. Once you know this, you can then
loop through the children by creating a temp child node, get or change
values e.t.c. and then goto the next child. .FirstSibling returns the first
child node and .Next returns the next node in line (use the .Next property
of the temp child node to get to the next child). Hope that made sense.
Unfortunatly, I dont have Access handy to give u an example and it's been a
while since I used this control.

Hope it gives you a starting point,

Neil.

"Dale Fye" <anonymous@discussions.microsoft.com> wrote in message
news:e98801c43cd5$4c54e830$a301280a@phx.gbl...
> I apparantly don't understand what a root is, because
> whenever I reference the root property of my treeview, it
> gives me a reference to node(1).
>
> I still have not figured out how to start at a given node
> (lets say on the nodechecked event) and identify all of
> the checked nodes children.
>
> If I know what the index is of a node, how can I move to
> that node (expand its parents to make sure it is visible)
> and highlight it?
>
> Also when I refer to the Parent property of a node that is
> one of the nodes that appears when all nodes are
> collapsed, Access give me an error: #91 "Object variable
> or with block not set". So how do I tell what level in
> the tree the node is at?



Relevant Pages

  • Re: Count all nodes in a treeview
    ... ItemIndex of the nodes in the tree. ... Parent Node: 0 ... Child Node: 0 ... a friend who codes in Delphi and has been using C# for quite a while. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How do you copy an array?
    ... the moves as you traverse the tree. ... otherwise how else do you pass all the previous moves to a child node? ... result of the minimax algorithm i.e. the outcome of the game: ...
    (comp.lang.lisp)
  • Re: XML TreeNode.Parent property when using 2.0 TreeView?
    ... when a child node with the value of 'name' is selected ... Now the next mystery is how to determine *which* parent and child have been ... smartest way to identify the group of nodes in a tree or if there is some ... selected when the tree contains redundantly named instances. ...
    (microsoft.public.dotnet.xml)
  • RE: Show/Hide multiple TabControls at runtime
    ... doing it in this kind of way though was from a memory usage point, ... Setting Visible to "true" makes the tab control appear and setting ... When they click a child node in the treeview, ... >> Should I destroy the current TabControl object, ...
    (microsoft.public.dotnet.general)
  • TreeView AfterSelect event sequence Bug?
    ... I've come across what I think is a bug in with the TreeView control and how ... Focus is currently on TextBox control. ... User clicks on a different child node ...
    (microsoft.public.dotnet.framework.windowsforms.controls)