2010-01-30 53 views

回答

0
void HighlightNodes(TreeNodeCollection nodes) 
{ 
    if (nodes != null) 
    { 
     foreach (TreeNode node in nodes) 
     { 
      // Process sub-nodes 
      if (node.Nodes.Count > 0) 
      { 
       HighlightNodes(node.Nodes); 
      } 

      if (criteriaIsMet) 
      { 
       node.BackColor = SystemColors.Highlight; 
      } 
      else 
      { 
       node.BackColor = Color.Empty; 
      } 
     } 
    } 
} 
相關問題