title: C# Assign Images to ListView Items by Name
body: <p>I would like to thank contributors in advanced, I am rather stuck on this one:</p>
  
  <p>I have created a List View called listView1 and when the program runs it displays data files (.txt, .doc etc) from a particular folder specified in a Tree View called treeView1. In these same folders next to the data files are icon files(.ico). I would like to assign a .ico to be displayed as the image for the .txt or .doc file that will be loaded into listView1. Both the data file and icon file have the same name just a different extension. Therefor I already have a way of matching the icon file to the data file. However, I cannot seem to find a way to programically assign the icon file as the image to be displayed for the data file in listView1. I cannot use a Image List because you can only assign images from a image list based on its image index not its name. All signs seem to point to creating a array but I cannot figure out how to assign an image in a array to a data file while I am adding it to listView1.</p>
  
  <p>I hope that makes sense, thank you!</p>