LvwVirtualListItem class
One item of a ListView in virtual mode: its number, the texts the program gave it, its state and its place. A program gets one from the LvwVirtualListItems collection.
' In a ListView whose VirtualMode is True.
With ListView1.VirtualListItems(10)
.Selected = True
.EnsureVisible
Debug.Print .Text; .Checked
End With
A program cannot make an LvwVirtualListItem object with New. The object stands for a number, and its texts and its check box are those that GetVirtualItem gives the control when it asks.
Properties
Checked
Whether the item’s check box is checked, as GetVirtualItem gives it. Boolean, read-only.
Height, Width
The height and the width of the item’s icon and text together, in the scale units of the control’s container. Single, read-only: an assignment raises run-time error 383.
Hot
Whether the item is the HotItem. Boolean. Setting it to True makes it the hot item, and False makes no item hot if it was.
Indentation
How far the item is moved to the right in the report view, in widths of a small icon, as GetVirtualItem gives it. Long, read-only.
Index
The number of the item, from 1. Long, read-only.
Left, Top
The place of the item’s icon in the control, in the scale units of the control’s container. Single. An assignment gives Windows a new place for the item, which the automatic arrangement of a virtual list can change again.
Selected
Whether the item is selected. Boolean. Setting it to True also gives the item the focus. A change raises ItemSelect.
SubItems
The text of one of the item’s subitems, as GetVirtualItem gives it. String, read-only, at most 259 characters.
Syntax: object.SubItems( Index )
- Index
- required An Integer: the number of the subitem, from 1 to the number of columns less 1. Another number raises run-time error 380.
Text
The item’s text, as GetVirtualItem gives it. String, read-only, at most 259 characters. It is the default member.
Visible
Whether the item is in the part of the control that can be seen. Boolean, read-only.
Methods
CreateDragImage
Returns the handle of a new image list of Windows that holds a picture of the item, as the CreateDragImage of an ordinary item does. The program destroys it when it is done. LongPtr.
Syntax: object.CreateDragImage( [ X ] [, Y ] ) As LongPtr
- X, Y
- optional Single variables that receive the place of the picture’s top left corner, in the scale units of the control’s container.
EnsureVisible
Scrolls the control so that the item can be seen.
Syntax: object.EnsureVisible
See Also
- Virtual Mode – a list the program supplies
- LvwVirtualListItems class – the items of a virtual list