METHOD autosize CLASS ListView     // Call this method to automatically resize     // all the columns in the listview     LOCAL i AS DWORD     LOCAL o AS ListViewColumn          FOR i := 1 TO SELF:columncount         o := SELF:getcolumn(i)         o:autosize()     NEXT
METHOD AutoSize() CLASS ListViewColumn     // This method will adjust the width of     // the column so that the widest item is     // completely visible     LOCAL dwIndex AS DWORD     LOCAL n AS DWORD     IF oOwner != NULL_OBJECT         dwIndex := oOwner:__GetColumnIndexFromSymbol(SELF:NameSym) - 1         ListView_SetColumnWidth(oOwner:Handle(), dwIndex, DWORD(_CAST,LVSCW_AUTOSIZE))         n := ListView_GetColumnWidth(oOwner:Handle(), dwIndex)         ListView_SetColumnWidth(oOwner:Handle(), dwIndex, DWORD(_CAST,LVSCW_AUTOSIZE_USEHEADER))         n := Max(n,ListView_GetColumnWidth(oOwner:Handle(), dwIndex))         ListView_SetColumnWidth(oOwner:Handle(), dwIndex, n)     ENDIF
Page generated from source code by VO Export Explorer, one of the utilities in the VO Productivity Pack