Adding subitems to a listview
I am not to familiar with VB 6 so forgive
.
I am using the following to add a second column :
Code:
Set item = listView.ListItems.Add(, , "AAA")
item.SubItems(1) = "BBB"
But the second line keeps giving me "Invalid property value".
Any ideas what I am doing wrong ?
TIA
Re: Adding subitems to a listview
When in doubt, Read That Fine Manual:
Code:
With ListView1
With .ColumnHeaders
'Since we want subitems, we must "add headers" for the number
'of columns we want. SubItems is a pseudo-array-like collection
'property, not actually an array. Quoting the manual:
'
' "You cannot add elements directly to the subitems array. Use
' the Add method of the ColumnHeaders collection to add subitems."
.Add
.Add
End With
With .ListItems.Add(, , "AAA")
.SubItems(1) = "BBB" 'Success!
End With
End With
Re: Adding subitems to a listview
Why open a NEW thread, for same problem, instead to continue the previous???
http://www.vbforums.com/showthread.p...y-ListViewItem