title: C# - TreeView Comparing Nodes
body: <p>I want to create a treeview to list all the squares found in the image along with its colors in each quadrant. If it sees the same colored square it will add anyway because it does the image processing for each frame.</p>
  
  <p>My problem is that I need to compare if the color of the child node already exists in the treeview. If it exists, dont add the node.</p>
  
  <pre><code>      if (quadrado_detetado == 1)
          {
  
              tv_lista_quadrados.Nodes.Add("Quadrado Detetado " + 
                                           increamenta_listagem_quadrados);
  
              if (tv_lista_quadrados.Nodes.Count &gt; 1)
              {
                  //Compare the current child node with all child nodes in the treeview ??
  
         if(//Doesnt Exist)
        //add          
             tv_lista_quadrados.Nodes[increamenta_listagem_quadrados].Nodes.Add
                       ("Cores: " + cores_dos_pontos_medios[0] + " " +
                                    cores_dos_pontos_medios[1] + " " +
                                    cores_dos_pontos_medios[2] + " " +
                                    cores_dos_pontos_medios[3] + " ");
                  }
  
                  else
                  {
                     //remove this node ??
                  }
              }
  
              increamenta_listagem_quadrados++;
          }
  
      }
  </code></pre>
  
  <p><code>quadrado_detetado</code> is an integer that tells when a square is found.</p>
  
  <p><code>cores_dos_pontos_medios</code> is an string array that includes the 4 colors found in the quadrants.</p>
  
  <p>Can anyone help me? How to I search the child nodes and compare?</p>