
This section contains information about the programming elements used with list view controls.
The following sections describe window style flags and item state flags that are used with list view controls.
The following window styles are specific to list view controls.
| LVS_ALIGNLEFT | Specifies that items are left-aligned in icon and small icon view. |
| LVS_ALIGNTOP | Specifies that items are aligned with the top of the list view control in icon and small icon view. |
| LVS_AUTOARRANGE | Specifies that icons are automatically kept arranged in icon and small icon view. |
| LVS_EDITLABELS | Allows item text to be edited in place. The parent window must process the LVN_ENDLABELEDIT notification message. |
| LVS_ICON | Specifies icon view. |
| LVS_LIST | Specifies list view. |
| LVS_NOCOLUMNHEADER | Specifies that a column header is not displayed in report view. By default, columns have headers in report view. |
| LVS_NOLABELWRAP | Displays item text on a single line in icon view. By default, item text may wrap in icon view. |
| LVS_NOSCROLL | Disables scrolling. All items must be within the client area. |
| LVS_NOSORTHEADER | Specifies that column headers do not work like buttons. This style can be used if clicking a column header in report view does not carry out an action, such as sorting. |
| LVS_OWNERDATA | Version 4.70. Specifies a virtual list view control. For more information about this list control style, see Virtual list view description. |
| LVS_OWNERDRAWFIXED | Enables the owner window to paint items in report view. The list view control sends a WM_DRAWITEM message to paint each item; it does not send separate messages for each subitem. The itemData member of the DRAWITEMSTRUCT structure contains the item data for the specified list view item. |
| LVS_REPORT | Specifies report view. When using the LVS_REPORT style with a list view control, the first column is always left-aligned. You cannot use LVCFMT_RIGHT to change this alignment. |
| LVS_SHAREIMAGELISTS | Specifies that the image list will not be deleted when the control is destroyed. This style enables the use of the same image lists with multiple list view controls. |
| LVS_SHOWSELALWAYS | Always show the selection, if any, even if the control does not have the focus. |
| LVS_SINGLESEL | Allows only one item at a time to be selected. By default, multiple items may be selected. |
| LVS_SMALLICON | Specifies small icon view. |
| LVS_SORTASCENDING | Sorts items based on item text in ascending order. |
| LVS_SORTDESCENDING | Sorts items based on item text in descending order. |
You can use the LVS_TYPEMASK mask to isolate the window styles that correspond to the current view: LVS_ICON, LVS_SMALLICON, LVS_LIST, and LVS_REPORT.
You can use the LVS_ALIGNMASK mask to isolate the window styles that specify the alignment of items: LVS_ALIGNLEFT and LVS_ALIGNTOP.
You can use the LVS_TYPESTYLEMASK mask to isolate the window styles that control item alignment (LVS_ALIGNLEFT and LVS_ALIGNTOP) and those that control header appearance and behavior (LVS_NOCOLUMNHEADER and LVS_NOSORTHEADER).
List view control styles have been extended. To use these new styles, use the LVM_SETEXTENDEDLISTVIEWSTYLE message or one of the ListView_SetExtendedListViewStyle or ListView_SetExtendedListViewStyleEx macros.
| LVS_EX_CHECKBOXES | Version 4.70. Enables check boxes for items in a list view control. Effectively, when set to this style, the control will create and set a state image list using DrawFrameControl. Check boxes are visible and functional with all list view modes. The state of the check box for a given item is obtained using the ListView_GetCheckState macro. |
| LVS_EX_FLATSB | Version 4.71. Enables flat scroll bars in the list view. If you need more control over the appearance of the list view's scroll bars, you should manipulate the list view's scroll bars directly using the Flat Scroll Bar APIs. |
| LVS_EX_FULLROWSELECT | Version 4.70. When an item is selected, the item and all its subitems are highlighted. This style is available only in conjunction with the LVS_REPORT style. |
| LVS_EX_GRIDLINES | Version 4.70. Displays gridlines around items and subitems. This style is available only in conjunction with the LVS_REPORT style. |
| LVS_EX_HEADERDRAGDROP | Version 4.70. Enables drag-and-drop reordering of columns in a list view control. This style is only available to list view controls that use the LVS_REPORT style. |
| LVS_EX_INFOTIP | Version 4.71. The list view control sends an LVN_GETINFOTIP notification message to the parent window before displaying an item's tooltip. This style is only available to list view controls that use the LVS_ICON style. |
| LVS_EX_MULTIWORKAREAS | Version 4.71. If the list view control has the LVS_AUTOARRANGE style, the control will not autoarrange its icons until one or more work areas are defined (see LVM_SETWORKAREAS). To be effective, this style must be set before any work areas are defined and any items have been added to the control. |
| LVS_EX_ONECLICKACTIVATE | Version 4.70. The list view control sends an LVN_ITEMACTIVATE notification message to the parent window when the user clicks an item. This style also enables hot tracking in the list view control. Hot tracking means that when the cursor moves over an item, it is highlighted but not selected. |
| LVS_EX_REGIONAL | Version 4.71. The list view will create a region that includes only the item icons and text and set its window region to that using SetWindowRgn. This will exclude any area that is not part of an item from the window region. This style is only available to list view controls that use the LVS_ICON style. |
| LVS_EX_SUBITEMIMAGES | Version 4.70. Allows images to be displayed for subitems. This style is available only in conjunction with the LVS_REPORT style. |
| LVS_EX_TRACKSELECT | Version 4.70. Enables hover selection in a list view control. Hover selection (also called track selection) means that an item is automatically selected when the cursor remains over the item for a certain period of time. The delay can be changed from the default system setting with the LVM_SETHOVERTIME message. This style applies to all styles of list view control. |
| LVS_EX_TWOCLICKACTIVATE | Version 4.70. The list view control sends an LVN_ITEMACTIVATE notification message to the parent window when the user double-clicks an item. This style also enables hot tracking in the list view control. Hot tracking means that when the cursor moves over an item, it is highlighted but not selected. |
| LVS_EX_UNDERLINECOLD | Version 4.71. Causes nonhot items to be displayed with underlined text. This style is ignored if LVS_EX_ONECLICKACTIVATE is not set. |
| LVS_EX_UNDERLINEHOT | Version 4.71. Causes hot items to be displayed with underlined text. This style is ignored if LVS_EX_ONECLICKACTIVATE or LVS_EX_TWOCLICKACTIVATE is not set. |
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.