find a TreeNode in a TreeView., how?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hey

..NET 2.0

I'm trying to search a TreeView control for a specific TreeNode

The code below doesn't work because it only searches the the top level of
the nodes. I would like to program it so that it can find a TreeNode
anywhere in the TreeView... any suggestions on how to implement it ??

private bool PreRemoveTabPage(TabPage tab)
{
foreach (TreeNode n in TreeView1.Nodes)
{
if ((TabPage)n.Tag == tab)
{
n.Tag = null;
}
}
return true;
}


.



Relevant Pages

  • Re: TreeView mouse click
    ... Lets say i want to expand the node when the user clicks on it. ... you have a TreeView control on your form and ... button or the space after the treenode, the MouseClick event is raised. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • RE: treeview
    ... As for the ASP.NET 2.0 TreeView control, its TreeNode collection is ... the databinding support only allow use to read from a given XML ... certain XML file and can reload it again into Treeview, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Sort xml?
    ... I got a page that loads a xml file into a treeview control. ... in one folder you can sort the items in any order you ... TreeNode mNode; ...
    (microsoft.public.dotnet.xml)
  • RE: TreeView mouse click
    ... you have a TreeView control on your form and ... button or the space after the treenode, the MouseClick event is raised. ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • RE: Can I use more than one style in a treeview control at the roo
    ... There is no Style property for individual TreeNode class object, ... Can I use more than one style in a treeview control at the ... |> root no ... |> | border, all the other root nodes should have a top border. ...
    (microsoft.public.dotnet.framework.aspnet)