B
bonkers
Yet another bizarre one...
I have a ListView populated with images from an Image List. When the user
selects one of these images, I wish to show an enlarged image in a
PictureBox.
The only way I have managed to do this so far, is to create two ImageLists,
one with the images at 16x16, and another with the images at 140x140. The
ListView's LargeIcon and SmallIcon lists are both from ImageList1.
When the ListView selection changes, it fires an event that captures the
index of the selection, and uses that to set the PictureBox.Image to an
image with the same index -- from ImageList2.
Problem is, for some reason, the ListView no longer displays the icons when
I use LargeIcon view. If I delete ImageList2, the icons show.
Just for the halibut, I tried changing the order of the object declarations
in the form's code. Didn't do anything for me, but I suppose it was worth a
try. I thought maybe imagelist2 was initializing after ImageList1 and
confusing things.
I also tried naming ImageList2 something completely different, and I tried
populating it with copies of the images from a different folder.
So
1) is there a simpler way to get the image that I want to display in the
PictureBox, a way that doesn't involve having two imageLists?
2) Has anyone come across this issue before and found a solution?
Thanks in advance,
Rissa
I have a ListView populated with images from an Image List. When the user
selects one of these images, I wish to show an enlarged image in a
PictureBox.
The only way I have managed to do this so far, is to create two ImageLists,
one with the images at 16x16, and another with the images at 140x140. The
ListView's LargeIcon and SmallIcon lists are both from ImageList1.
When the ListView selection changes, it fires an event that captures the
index of the selection, and uses that to set the PictureBox.Image to an
image with the same index -- from ImageList2.
Problem is, for some reason, the ListView no longer displays the icons when
I use LargeIcon view. If I delete ImageList2, the icons show.
Just for the halibut, I tried changing the order of the object declarations
in the form's code. Didn't do anything for me, but I suppose it was worth a
try. I thought maybe imagelist2 was initializing after ImageList1 and
confusing things.
I also tried naming ImageList2 something completely different, and I tried
populating it with copies of the images from a different folder.
So
1) is there a simpler way to get the image that I want to display in the
PictureBox, a way that doesn't involve having two imageLists?
2) Has anyone come across this issue before and found a solution?
Thanks in advance,
Rissa