| | |
Put picture before ListViewItem
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2008
Posts: 173
Reputation:
Solved Threads: 1
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 ?
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 ?
C++ Syntax (Toggle Plain Text)
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; }
Last edited by Lukezzz; Nov 4th, 2008 at 7:05 pm.
•
•
Join Date: Mar 2008
Posts: 173
Reputation:
Solved Threads: 1
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.
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.
Last edited by Lukezzz; Nov 5th, 2008 at 2:19 pm.
![]() |
Other Threads in the C++ Forum
- Previous Thread: read a text from a text file
- Next Thread: A little problem
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





