title: .NET TreeView won't show images
body: <p>Having a problem getting a TreeView control to display node images. The code below works sometimes but fails to show any image at other times.</p>
  
  <pre><code>
  private TreeNode AddNodeForCore(TreeNode root, Core c) {
      string key = GetImageKey(c);
      TreeNode t = root.Nodes.Add(c.Name, c.Name, key, key);
      t.Tag = c;
      return t;
  }
  </code></pre>
  
  <p>Note that when it fails, the TreeView fails to show any images for any node. The TreeView does have an ImageList assigned to it, and the image key is definitely in the images collection.</p>
  
  <p>Edit:<br>
  My google-fu is weak. Can't believe I didn't find that answer myself.</p>