The ListView_ColumnSetWidth() function sets the width of the specified column.


ListView_ColumnSetWidth(list_view_field, column_index, width)


list_view_field – The list view field containing the specified column.

column_index – An integer specifying the index of the column whose width is being set. The value 1 indicates the first column that was added to the list view field.

Dragging a column to a different position in the list view does not affect the column index.

width – An integer specifying the column width in pixels. If you are setting the width of a column that contains the icon image or state image for the item, include the constant LV_ICON_WIDTH to account for the width of the image.

To automatically set the width of the column, use one of the following constants:





Sets the width of the column so that the widest item in the column will be fully displayed.


This constant can be used only for the last column. The column will be resized to fill the remaining space in the list view field.

Return value

An integer indicating the previous width of the column.

Documentation Feedback