I am using C#.net with 3.5 frame work. I have a form having a listview and imagelist controls. i am adding images from a folder to imagelist and then from imagelist to listview. This is working fine and show images, However how can i show the image names too.
Asked
Active
Viewed 1,342 times
3 Answers
0
There are two ways of doing it..
- If you are storing image in DB. then also you should save your image's name in DB. and while displaying fetch that record along with other records to display it on UI.
- If you are stoing images in some directory of your application. then you must be saving Image name with path or without path in DB. you can fetch and display your name by extracting it along with other fields in your SQL Query..

Mayank Pathak
- 3,621
- 5
- 39
- 67
-
i am not using any db. just reading from a folder and showing in listview – Iorn Man Sep 12 '12 at 10:41
0
I guess you want to set the View property:
ListView.LargeIcon
for instance displays the image with a label below it.
Also, if you're going to work with ListViews, I'd suggest you look into ObjectListView, it's very flexible and allows you to develop more beautiful listview controls.

Chibueze Opata
- 9,856
- 7
- 42
- 65
-
I am using "listview.LargeIcon" property but still it shows only images and not labels below them. please help. – Iorn Man Sep 12 '12 at 10:39
-
Are you sure you're assigning labels to the images? Post the code that you're using if you're doing this... – Chibueze Opata Sep 12 '12 at 10:41
-
-
Yes, you have to extract the test and assign it to the ListView item. – Chibueze Opata Sep 12 '12 at 10:57
0
In design time, edit the Items collection, and set their Text property with the text of the label you want to show.
Here you can see an image on where to find the Text property.
In runtime time, you can also set their Text property.

Jordi R Cardona
- 1
- 2
-
1Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 08 '21 at 15:06