Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Recursive: See recursive
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01083365
Message ID:
01083449
Vues:
10
This message has been marked as the solution to the initial question of the thread.
Hi,
How about:
private bool RecursiveMethod(TreeNode treeNode)
{
   if (foo == bar)
   {
     MessageBox.Show(treeNode.Text); // I don't want to continue my recursive search!!
      return true;
   }

   foreach (TreeNode tn in treeNode.Nodes)
   {
      if (RecursiveMethod(tn)) return true;
   }
   return false;
}
( and update the calling method to match)
HTH,
Viv
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform