m_li.SetExtendedStyle(LVS_EX_GRIDLINES|LVS_EX_FULLROWSELECT|LVS_EX_ONECLICKACTIVATE);
m_li.InsertColumn(0,"姓名",LVCFMT_LEFT,80);
m_li.InsertColumn(1,"性别",LVCFMT_LEFT,60);
m_li.InsertColumn(2,"年龄",LVCFMT_LEFT,60);
m_li.InsertItem(0,"王楠"); //要插入了Item后才能设置Item的Text
m_li.InsertItem(1,"李平");
int a=99;
CString str;
str.Format("%i",a);
m_li.SetItemText(1,2,str);
单击CListCtrl后
POSITION pos = m_li.GetFirstSelectedItemPosition();
UINT i=m_li.GetNextSelectedItem(pos);
char pBuf[11]="";
CString s=m_li.GetItemText(i,2);
// itoa(i,pBuf,10);
MessageBox(s);
09.9.23
Invalidate();//重绘界面