0

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;
}
1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by Lukezzz
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.