Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This message sets the spacing between icons in list-view controls that have the LVS_ICON style.

Syntax

LVS_SETICONSPACING 
wParam = 0; 

lParam = (LPARAM) MAKELONG(
cx, 
cy);

Parameters

cx

Distance, in pixels, to set between icons on the x-axis. Setting this value to –1 resets the cxparameter to default spacing.

cy

Distance, in pixels, to set between icons on the y-axis. Setting this value to –1 resets the cy parameter to default spacing.

Return Value

Returns a DWORDvalue that contains the previous cxin the low-order word, and the previous cyin the high-order word.

Remarks

Values for cxand cyare relative to the upper-left corner of an icon bitmap. Therefore, to set spacing between icons that do not overlap, the cxor cyvalues must include the size of the icon, plus the amount of empty space desired between icons. Values that do not include the width of the icon will result in overlaps.

Related macro:  ListView_SetIconSpacing

Requirements

Header commctrl.h
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also