How is it possible to put a picture before the listviewItem.
Under C: I have a picture.bmp that I would want before "Item" in
the listView1. I use "details" as for the property in the listView.

"Item" comes up 5 times in a List but no picture.
What could I be doing wrong ?

for( int i = 0; i < 5; i++)
{
ImageList^ imageListSmall = gcnew ImageList;
imageListSmall->Images->Add( Bitmap::FromFile( "C:\\picture.bmp" ) );


listView1->Items->Add("Item");
listView1->SmallImageList = imageListSmall;
}

I have added 2 columns in the listView and when running the code above, the listview makes a space where the picture should have come, but the space is white and emty.
The picture I use is a .bmp 16x16.

In the code I should have been created an ImageList^ ,then as I understand I have
Assigned the ImageList to the ListView SmallImageList property and finally I have
Assigned for each listviewitem in the listview an image index to their
ImageIndex property.


I have not really any idéa what to change or add in this code. I am googling around but cant find any good answer.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.