PDA

View Full Version : Listview_SetColumnWidth



Michael Clease
25-11-2011, 01:14
Could I have this as native keyword.

[/CODE]

From Jose Roca Winapi files but tweaked

Function ListView_SetColumnWidth ( _
ByVal hwndLV As DWord, ByVal iCol As Long, _
ByVal cx As Integer ) As Long


Function = SendMessage(hwndLV, %LVM_SETCOLUMNWIDTH, iCol, MAKLNG( cx, 0))

End Function




Usage:

you already have the equates setup



%LVSCW_AUTOSIZE = -1
%LVSCW_AUTOSIZE_USEHEADER = -2

For n = 0 To NumberofColumns
ListView_SetColumnWidth(Control_GetHandle(CBHNDL, %ID_Lvw),N,%LVSCW_AUTOSIZE)
Next

ErosOlmi
25-11-2011, 08:35
Dear Michael,

sorry, my mistake: Exec_ListView_SetColumnWidth is already in UI module but I forget to document.

Syntax is:
Exec_ListView_SetColumnWidth(hParent, ctrlID, lColumn, lSize)

Let me know.
Ciao
Eros