LvwVirtualListItems class
The items of a ListView in virtual mode, which its VirtualListItems property returns. Its items are LvwVirtualListItem objects, numbered from 1 to the control’s VirtualItemCount. The program holds the data; the collection only reaches the items the control shows, by number.
' In a ListView whose VirtualMode is True.
Dim i As Long
With ListView1.VirtualListItems
For i = 1 To .Count
If .Item(i).Selected Then Debug.Print "Selected:"; i
Next
End With
A program goes through the items with For Each, or by number from 1 to Count. It cannot make an LvwVirtualListItems object with New. While the control is not in virtual mode, reading VirtualListItems raises run-time error 91.
Properties
Count
The number of items, the control’s VirtualItemCount. Long, read-only.
Item
Returns one item. It is the default member, so ListView1.VirtualListItems(5) is ListView1.VirtualListItems.Item(5).
Syntax: object.Item( Index ) As LvwVirtualListItem
- Index
- required A Long: the number of the item, from 1 to Count. Another number raises run-time error 35600.
Methods
Exists
Returns whether there is an item of a number, from 1 to Count. Boolean.
Syntax: object.Exists( Index ) As Boolean
See Also
- Virtual Mode – a list the program supplies
- LvwVirtualListItem class – one item