ListView_ColumnSetWidth()

Examples


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

Syntax

ListView_ColumnSetWidth(list_view_field, column_index, width)

Parameters

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:

[spacer]

Constant

Description

LV_AUTO_SIZE

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

LV_AUTO_FIT

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