Listview loading images and text

  • Thread starter Thread starter gjsimms
  • Start date Start date
G

gjsimms

Guest
I need to offer users a list of images, and their descriptions, so they can select (only) one. I envisioned something like a spreadsheet, 1st column is the image and the second column its description. I am using VB.NET and it seemed that a listview might do this but I have not used this control before and I cannot get it to work as I would like.

My images are all 110 wide by 55 high and the descriptions are up to (say) 100 characters. The images are held in a Imagelist. My ListView is lsvLoadCases and it has 2 columns

My code is;

lsvLoadCases.View = View.LargeIcon
lsvLoadCases.LargeImageList = imgListLoadCases


'This gives me what seems to be tiles with the description beneath the image

lsvLoadCases.Items.Add("Torsional restraint at one end only." & vbCrLf & " No end restrains warping. Point torque applied at the free end", 0)
etc...

and this

'Dim item1 As ListViewItem = New ListViewItem("", 0)
'item1.SubItems.Add("description1")
'lsvLoadCases.Items.Add(item1)

just gives the image and no text.


How can I get the images in column1 and the descriptions in column2?


I

Continue reading...
 
Back
Top