' All the other columns to have a narrower width For i = 1 To NumCol lvc.mask = LVCF_FMT OR LVCF_WIDTH OR LVCF_TEXT OR LVCF_SUBITEM If i = NumCol then ' Leave the last column header blank as we are NOT putting data ' into this last column ( it act like a buffer ) txtStr = "" Else txtStr="Column #" & str(i+1) txtStr = Trim(txtStr) End if lvc.pszText = txtStr lvc.iorder = i ListView_InsertColumn(hListview, i, &lvc) Next i

' Set the column widths according to width of each column header for i = 0 to NumCol -1 ListView_SetColumnWidth(hListview,i,LVSCW_AUTOSIZE_USEHEADER) next i ' make the last column a very narrow width as it is only a buffer column ' this would display as a double line ListView_SetColumnWidth(hListview,NumCol,3)

' Place in the extended style for the listview SendMessage(hListview, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT or LVS_EX_CHECKBOXES or LVS_EX_GRIDLINES )

' Shade those unused background portions of the main ListView to Alice Blue ' while the text color is Navy SendMessage(hListView, LVM_SETTEXTCOLOR, 0,RGB(0,0,128)) SendMessage(hListView, LVM_SETBKCOLOR, 0,RGB(240,248,255))