修改Listctrl的显示Style

//if the current style is not report, the following three lines is not need
GetListCtrl().DeleteAllItems();
for(int h=GetListCtrl().GetHeaderCtrl()->GetItemCount();h>0;h--)
GetListCtrl().DeleteColumn(h-1);
LONG lStyle;
//Get current window style
lStyle=GetWindowLong(GetListCtrl().GetSafeHwnd(),GWL_STYLE);
//Clear original type mask
lStyle &= ~LVS_TYPEMASK;
//Add new type style,the sample is icon
lStyle|=LVS_ICON;
//Ok,set new type style
SetWindowLong(GetListCtrl().GetSafeHwnd(),GWL_STYLE,lStyle);

你可能感兴趣的:(style)