CListCtrl::SetColumnWidth This method changes the width of a column in report view or list view.BOOL SetColumnWidth( int nCol, int cx ); Parameters nCol Specifies the index of the column whose width is to be set. In list view, this parameter must be –1. cx Specifies the new width of the column. Can be either LVSCW_AUTOSIZE, LVSCW_AUTOSIZE_USEHEADER or LVM_SETCOLUMNWIDTH.
方法2,遍历该列,用函数CListCtrl::GetStringWidth求每个宽度,取最大值,
然后CListCtrl::SetColumnWidth()重设宽度就可以了
This method changes the width of a column in report view or list view.BOOL SetColumnWidth(
int nCol,
int cx );
Parameters
nCol
Specifies the index of the column whose width is to be set. In list view, this parameter must be –1.
cx
Specifies the new width of the column. Can be either LVSCW_AUTOSIZE, LVSCW_AUTOSIZE_USEHEADER or LVM_SETCOLUMNWIDTH.