LVM_SETICONSPACING message

Sets the spacing between icons in list-view controls that have the LVS_ICON style. You can send this message explicitly or by using the ListView_SetIconSpacing macro.

Parameters

wParam

Must be zero.

lParam

The LOWORD specifies the distance, in pixels, to set between icons on the x-axis. The HIWORD specifies the distance, in pixels, to set between icons on the y-axis. See Remarks.

Return value

Returns a DWORD value that contains the previous x-axis distance in the low word, and the previous y-axis distance in the high word.

Remarks

Values for lParam are relative to the upper-left corner of an icon bitmap. Therefore, to set spacing between icons that do not overlap, the lParam values 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.

When defining the icon spacing, the lParam values must set to 4 or larger. Smaller values will not yield the desired layout. To reset the icons to the default spacing, set the lParam values to -1.

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Header
Commctrl.h