Arrange, View Property

Purpose

Arrange and SnapToGrid returns or sets a value that determines how the icons in a ListView control's Icon or SmallIcon View are arranged. View returns or sets the appearance of the ListItem objects in a ListView control.

Syntax

ListView.Arrange [= value]

ListView.View [= value]

value:iexp

Description

The Arrange settings for value are:

0 None (Default)
1 Left Items are aligned automatically along the left side of the control.
2 Top Items are aligned automatically along the top of the control.

The View property values are:

0 Icon (Default) Each ListItem object is represented by a full-sized (standard) icon and a text label.
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.
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.
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.

Example

OpenW 1

' View property

Global Enum lvwIcon = 0, lvwSmallIcon, lvwList, lvwReport

' Arrange property (valid for lvwIcon, lvwSmallIcon)

Global Enum lvwNone = 0, lvwAutoLeft, lvwAutoTop

Ocx ImageList iml

iml.ListImages.Add , "comp", CreatePicture(LoadIcon(_INSTANCE, 1), False)

Ocx ListView lv = "", 100, 10, 140, 250, 200

lv.ColumnHeaders.Add , , "Column #1"

lv.ColumnHeaders.Add , , "Column #2"

lv.View = lvwSmallIcon

lv.Arrange = lvwAutoTop

lv.Icons = iml

lv.SmallIcons = iml

lv.Add , , "ListItem #1", "comp"

lv.ListItems.Add , , "ListItem #2", "comp"

lv.AddItem , , "ListItem #3", "comp"

Do

Sleep

Until Me Is Nothing

See Also

ListView, Icons, SmallIcons

{Created by Sjouke Hamstra; Last updated: 10/10/2014 by James Gaite}