
*** ListView Items on one row - different columns
Quote:
> Hello everybody,
> In the ListView, how can I show more than one field in a row ?? When I
use the
> following:
> lvwSelectedItems.ListItems.Add, , "FieldName"
> I get only one string in the row, which is "FieldName". So, how can I
make more
> than one item appear on one row ??
You have to put the ListView into Report view. Then you have to add items
to the ListView's ColumnHeaders collection. THEN, for each of your items,
you need to add items to the SubItems() collection. It seems a bit
roundabout, but it makes sense.
You can either define your ColumnHeaders via the tab on the properties
window for the ListView, or you can create them programatically.
After you get this working, be sure to check out article #Q147666 in the
Microsoft knowledge base, which explains why setting the ColumnHeaders'
Width property doesn't work properly and gives an example of using the
Win32 API to fix it.
Bob Rossney