title: Setting images from icons in a TreeView
body: <p>I'm writing my own C#-based application launcher, and, while I get it to populate the <code>TreeView</code> and launch application shortcuts in it, I can't seem to figure out how to add the icons as images to the <code>TreeView</code>. My current code for getting the files is:</p>
  
  <pre><code>    private void homeMenu_Load(object sender, EventArgs e)
      {
          this.ShowInTaskbar = false;
          if (Directory.Exists((Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)).FullName + "\\Roaming\\Launcher")))
          {
  
          }
          else
          {
              Directory.CreateDirectory(Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)).FullName + "\\Roaming\\Launcher");
          }
  
          DirectoryInfo launcherFiles = new DirectoryInfo(Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)).FullName + "\\Roaming\\Launcher");
  
          lstPrograms.Nodes.Add(CreatingDirectoryTreeNode(launcherFiles));
  
          lstPrograms.Sort();
  
      }
  
      private static TreeNode CreatingDirectoryTreeNode(DirectoryInfo directoryInfo)
      {
          var directoryNode = new TreeNode(directoryInfo.Name);
  
          foreach (var directory in directoryInfo.GetDirectories())
          {
              directoryNode.Nodes.Add(CreatingDirectoryTreeNode(directory));
          }
  
          foreach (var file in directoryInfo.GetFiles())
          {
              directoryNode.Nodes.Add(new TreeNode(file.Name));
          }
  
          return directoryNode;
      }
  </code></pre>
  
  <p>The main problem I have is adding the icon to the TreeList's ImageList to the particular node. I know I need to add:</p>
  
  <pre><code>lstPrograms.ImageList.Images.Add(Icon.ExtractAssociatedIcon());
  </code></pre>
  
  <p>to actually add the icon to the image list, how do I get that particular image's index, then add it to the <code>TreeView</code> with its relative file?</p>