views:

33

answers:

1

Hello,

I have loaded a collection of images into a folder(icons), and I am wondering how I can load all of these into a listview during the startup of the program. I am trying to get them to load into the view, showing the picture with a caption or description under the image.

After this, I plan(somehow) to select one and click within a picturebox to add the icon within the box at the mouse cursor.

I am relatively new to doing these types of things within C#.

A: 

I think you need the ListView.LargeImageList or ListView.SmallImageList property.
Note that their default value is null, meaning that you have to assign a new ImageList object to them. After this you can load your images to the ImageList.

You can then set the index of the image to display with the ListViewItem.ImageIndex property.
As for loading images from files, you can use the Image.FromFile method.

I am not quite sure that I understand completely what you're trying to achieve from this point on, but I think the ListView.ItemSelectionChanged event can give you what you want.

ShdNx