Answer the question
In order to leave comments, you need to log in
How to find all nodes of a treeView?
Can't get all treeView nodes. When executing the following code, only the first node's Text is displayed endlessly:
private void Button_Click(object sender, EventArgs e)
{
if (searchOnAll.Checked == true)
{
TreeNodeCollection nodes = themes.Nodes;
foreach (TreeNode tn in nodes)
{
CallAllNodes(tn);
}
}
}
private void CallAllNodes(TreeNode node)
{
MessageBox.Show(node.Text);
foreach (TreeNode tn in themes.Nodes)
{
CallAllNodes(tn);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question