After reading up in the Microsoft documentation, I'm positive this issue is caused by the resizing. It says that the image list clears out the images when ever you set the size of the images.
In the code snippet provided, i simply moved the size assignment of the image list (line 38) to the top of the method and removed (line 39) the imagelist1 assignment within the loop; which is no longer needed.
That should do it!
Main Topics
Browse All Topics





by: KrisTheComputerGuyPosted on 2009-09-25 at 02:02:42ID: 25421177
Which image gets displayed, the first image, or the last image in the database? This would help me in deducing the cause problem.
All the images in the image list must all have the same size. Resizing the image list may be clearing the images. try commenting out that line.
If that doesn't work, you can try loading the image file before adding the listviewitem to the listview. Just in case the listview is checking to see if the image actually exists.