title: How do I loop through all layers of Treeview nodes?
body: <p><strong><em>Read EDIT 2 first</em></strong></p>
  
  <p>I am trying to set up some way to visually distinguish the nodes in a winform app.  For example, alternating colors.</p>
  
  <p>Can some one start me down that path?  Also, has anyone else had to do that before and how  did you do it?</p>
  
  <p>Thanks</p>
  
  <h2>EDIT</h2>
  
  <p>I had seen the backcolor setting as well(Thank You) but I am having trouble getting it to work.  I do not see a Paint() event for treeviews.  I tried putting the below code in my Form Load() but it isn't working.  Possibly because the treeview is loaded yet??</p>
  
  <pre><code>        private void frmCaseNotes_Load(object sender, System.EventArgs e)
      {
          foreach (TreeNode treeNode in treeView1.Nodes[0].Nodes)
          {
              treeNode.BackColor = Color.DeepSkyBlue;
          }
      }
  </code></pre>
  
  <h2>EDIT 2</h2>
  
  <p>Okay, I have the initial problem out of the way using the below on Form_Load()</p>
  
  <pre><code>            foreach (TreeNode treeNode in treeView1.Nodes)
          {
              if (treeNode.Index % 2 == 0)
              {
                   treeNode.ForeColor = Color.DodgerBlue;
              }
              else
              {
                  treeNode.ForeColor = Color.Goldenrod;
              }
  </code></pre>
  
  <p>Now what I need to figure out, with someone's help, is how to Loop through <strong>ALL</strong> layers of nodes and apply my alternating coloring.  If I do something along the below lines I can <em>achieve</em> this.</p>
  
  <pre><code>            foreach (TreeNode treeNode in treeView1.Nodes[1].Nodes[0].Nodes)
          {
              if (treeNode.Index % 2 == 0)
              {
                   treeNode.ForeColor = Color.DodgerBlue;
              }
              else
              {
                  treeNode.ForeColor = Color.Goldenrod;
              }
  </code></pre>
  
  <p>How do I iterate through ALL layers programatically?</p>