By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

AutoIt ListView Styles

This reference on Brugbart covers the different ListView styles in ListviewConstants.au3

Edited: 2012-12-19 16:04

Please note, you will need to include ListviewConstants.au3 before these styles will work.

#include <ListviewConstants.au3>

Trying to use them without will result in an error like:

C:\Users\MyComputerName\Desktop\GUICtrlCreateListView.au3 (15) : ==> Variable used without being declared.:

$listview = GUICtrlCreateListView("Test", 10, 10, 200, 150, $LVS_LIST)

$listview = GUICtrlCreateListView("Test", 10, 10, 200, 150, ^ ERROR

Note. You do not need to include the file if you are using an UDF such as GuiListView.au3 since it already includes it.

ListView Styles

$LVS_ICONSpecifies Icon View
$LVS_REPORTSpecifies Report View
$LVS_SMALLICONSpecifies Small Icon View
$LVS_LISTSpecifies List View – no column headers are shown
$LVS_EDITLABELSMakes it possible to edit items in-place.
$LVS_NOCOLUMNHEADERRemoves the column header.
$LVS_NOSORTHEADERThe column header doesn't act as a button – useful when no column-sorting is needed.
$LVS_SINGLESELOnly one item at a time can be selected.
$LVS_SHOWSELALWAYSIf there is a selection, it is always shown, even if the control does not have focus.
$LVS_SORTASCENDINGSort items in ascending order.
$LVS_SORTDESCENDINGSort items in descending order.
$LVS_NOLABELWRAPItem text is displayed on a single line in icon view. Disables wrapping in icon view.

ListView Extended Styles

$LVS_EX_FULLROWSELECTWhen an item is selected, the item and all its subitems are selected.
$LVS_EX_GRIDLINESDisplay grid lines around items and subitems.
$LVS_EX_HEADERDRAGDROPEnables drag and drop re-ordering of columns.
$LVS_EX_TRACKSELECTEnables hot track selection for list view items – an item will automatically be selected when the mouse remains over it for a period of time.
$LVS_EX_CHECKBOXESEnables checkboxes in a list view control.
$LVS_EX_BORDERSELECTWhen selecting an item, the border color of items will change, rather than the item being highlighted.
$LVS_EX_DOUBLEBUFFERPaints with double-buffering, to reduce flicker.
$LVS_EX_FLATSBEnables flat scroll-bars in the list view.
$LVS_EX_MULTIWORKAREASIcons will be auto-arranged until one or more work-areas has been defined.
$LVS_EX_SNAPTOGRIDIcons will automatically snap to grid in the list view.
$LVS_EX_SUBITEMIMAGESAllow images to be displayed for subitems.