Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a listview set to details view and im using the following code on Form Load to add items and subitems to the list but I would like to have a small image in front of each item but I can't figure out the code to do that

 

       ListView1.Items.Add("Overall")
       ListView1.Items(0).SubItems.Add(SubVals(0))
       ListView1.Items(0).SubItems.Add(SubVals(1))
       ListView1.Items(0).SubItems.Add(SubVals(2))
       ListView1.Items.Add("Attack")
       ListView1.Items(1).SubItems.Add(SubVals(0))
       ListView1.Items(1).SubItems.Add(SubVals(1))
       ListView1.Items(1).SubItems.Add(SubVals(2))

Posted

i was able to get my images on the items with no problem but now I can figure out how to get an image on the subitems.

 

To get the image on the item i used

ListView1.Items.Add("Overall").ImageIndex = 15

 

So i thought for the subitem i would just use

ListView1.Items(0).SubItems.Add(OveR - SubVals(0)).ImageIndex = 20

 

but it doesnt work for the subitems.. what is the code for the subitems?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...