List views

List-view controls display items in four different views. The control's window style specifies the current view. Additional window styles specify the alignment of items and control-specific features. The following table describes the four views.

View Name Description Image
Icon view Specified by the LVS_ICON window style. Each item appears as a full-sized icon with a label below it. The user can drag the items to any location in the list-view window.
Small icon view Specified by the LVS_SMALLICON window style. Each item appears as a small icon with the label to the right of it. The user can drag the items to any location.
List view Specified by the LVS_LIST window style. Each item appears as a small icon with a label to the right of it. Items are arranged in columns and the user cannot drag them to an arbitrary location.
Report view Specified by the LVS_REPORT window style. Each item appears on its own line, with information arranged in columns. The leftmost column is always left justified and contains the small icon and label. Subsequent columns contain subitems as specified by the application. Each column has a header, unless you also specify the LVS_NOCOLUMNHEADER window style.

You can change the view type after you create a list-view control. To retrieve and change the window style, use the GetWindowLong and SetWindowLong functions. To determine the window styles of the current view, use the LVS_TYPEMASK value.

You can control the way items are arranged in icon or small icon view by specifying either the LVS_ALIGNTOP (default) or LVS_ALIGNLEFT window style.

You can change the alignment after you create a list-view control. To determine the current alignment, use the LVS_ALIGNMASK value.

Styles