ListView Icons

Phreak

Regular
Joined
Jun 7, 2002
Messages
62
Location
Iowa, United States
Okay, I did a search for this, but had no luck whatsoever, so I'm just going to ask.

I want to have some sort of list (probably a listview control), to contain a list of "contacts", next to each contact I would like an image. Is there a way to do this with ListView or do I need to look towards a different control.

Example of what I'm looking for would be the "Buddy List" in either AIM or MSN Messenger.

Thanks!
 
Well this is VB6 knowledge but here goes:
The ListView is just what you asked for.

Just don't forget toset the ListView.View Property to "Details".

Then you can give every listitem an icon and show additional information in the subitems.
 
Add a listview to your form, add an image list, set the listview to smallicon view and then select the imagelist as the smallicon property in listview properties, add an image to the imagelist, in this case it's got only 1 image and the index for that image is 0, then to add the text with that image next to it you do the following...
Visual Basic:
ListView1.Items.Add("Message", 0) '// 0 is the image index for that particular image in the imagelist , the "Message" obviously being your own text to add to the list.
hope this helps.
 
A buddy list would work from a treeview as well, you could also great groups, just remove the tree lines if you dont want them.
 
Back
Top