Lanc1988 Posted July 17, 2008 Posted July 17, 2008 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)) Quote
Lanc1988 Posted July 17, 2008 Author Posted July 17, 2008 nevermind, i figured it out by using an image collection control Quote
Lanc1988 Posted July 17, 2008 Author Posted July 17, 2008 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? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.