ListView Confusion

grifter102
03-27-2003, 08:09 AM
I'm completely new to VB, and want to use a ListView control in a project of mine. I've downloaded a sample from Microsoft, but it seems extremely complicated as it uses TreeView, StatusBar, ProgressBar and ListView all at the same time, so I can't seem to pull out which code applies to the populating of a listview.

So, first, is there any good tutorial on how to use the basic listing features of a listview (My MSDN cd is gone, so I can't look up the basic MS help on it either)? Second, is there an easy way to get data into a listview (from an ADODB.recordset or just any data type)?

GMan_NC
03-27-2003, 08:12 AM
If you do a search in this forum for ListView you will get a lot of results.

grifter102
03-27-2003, 08:22 AM
If you do a search in this forum for ListView you will get a lot of results.

thanks... I did a search before, and everything was too advanced. I did find a code sample though, that has enough simple information in it for me to use. Thanks.

GMan_NC
03-27-2003, 08:29 AM
Ok, If you have any more specific questions I'll be glad to help. As far as populating the list view from an ADODB.Recordset, here's a little code to help. This assumes you have a recordset object(rst) declared and open.

Dim itm as ListItem
While Not rst.EOF
'populate first column with first field
Set itm = ListView1.ListItems.Add(, , rst!Field1)
'populate second column with second field
itm.SubItems(1) = rst!Field2
'loop until end of recordset
rst.MoveNext
Wend

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum