for(i = 0; i < 5; i++)  
{
lvcolumn.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH | LVCF_ORDER;
lvcolumn.fmt = LVCFMT_LEFT;
lvcolumn.pszText = rgtsz[i];
lvcolumn.iSubItem = i;
lvcolumn.iOrder = i;
lvcolumn.cx = rect.Width() / 4;  
m_ListCtrl.InsertColumn(i, &lvcolumn);  
}

解决方案 »

  1.   

    该listctrl使用report style,不行删掉该listctrl,从新拖个listctrl
      

  2.   

    试一下这个:
      CListCtrl *theCtrl = &GetListCtrl();
      theCtrl->InsertColumn(0, _T("Player Name"), LVCFMT_LEFT);
      theCtrl->InsertColumn(0, _T("Jersey Number"),LVCFMT_LEFT);
    这样就行了。
      
      
      

  3.   

    只有report风格的list才能添加列
    在precreatewindow里面修改ListView的风格。
      

  4.   

    我的程序是SDI的,请告知具体应该如何改?谢谢!
      

  5.   


    直接加一行
    theCtrl.ModifyStyle(LVS_ICON | LVS_SMALLICON | LVS_LIST, LVS_REPORT);
    也可以。