I have a ListView and ImageList in C # in my form and read a directory with a maximum number of files per 1000 files. I pre-populate the ListView and ImageList with the number of FileItems DummyItems using the AddRange methods to avoid flickering and scaling of the ListView.
Now in the second stage, I just wanted to assign information about the correct object to the fictitious elements, while I was reading real objects from the file system. The sofar position text is not a problem, but I cannot replace the dummy images. If I try to do this, it throws an invalid argument exception. To remove an image using RemoveAtIndex or RemoveAtKey and then re-adding it will take me a while to iterate through 1000 files. 1000 files take 8 minutes with "RemoveAtKey" in ImageList. "RemoveAtKey" is the bottleneck that I recognized. If I try to clear all images before and again using AddRange, my element images will be empty or an exception will occur. Does anyone know how I get 1000 different thumbnails from 1000 files with a file name quickly in a listview control using other methods than I use?
source share