Visual Basic: Windows Controls

View Property (ListView Control)

See Also    Example    Applies To

Returns or sets the appearance of the ListItem objects in a ListView control.

Syntax

object.View [= value]

The View property syntax has these parts:

Part Description
object The object expression that evaluates to a ListView control.
value An integer or constant specifying the control's appearance, as described in Settings.

Settings

The settings for value are:

Constant Value Description
lvwIcon 0 (Default) Icon. Each ListItem object is represented by a full-sized (standard) icon and a text label.
lvwSmallIcon 1 SmallIcon. Each ListItem object is represented by a small icon and a text label that appears to the right of the icon. The items appear horizontally.
lvwList 2 List. Each ListItem object is represented by a small icon and a text label that appears to the right of the icon. The ListItem objects are arranged vertically, each on its own line with information arranged in columns.
lvwReport 3 Report. Each ListItem object is displayed with its small icon and text labels. You can provide additional information about each ListItem object in a subitem. The icons, text labels, and information appear in columns with the leftmost column containing the small icon, followed by the text label. Additional columns display the text for each of the item's subitems.

Remarks

In Icon view only, use the LabelWrap property to specify if the ListItem object's labels are wrapped or not.

In Report view, you can hide the column headers by setting the HideColumnHeaders property to True. You can also use the ColumnClick event and the Sorted, SortOrder, and SortKey properties to sort the ListItem objects or subitems when a user clicks a column header. The user can change the size of the column by grabbing the right border of a column header and dragging it to the desired size.