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
[/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