CListCtrl* pList = (CListCtrl*)GetDlgItem(IDC_LIST1);
ASSERT(pList);
pList->ModifyStyle(0, LVS_REPORT | LVS_SHOWSELALWAYS | LVS_EDITLABELS);
pList->SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_CHECKBOXES);
pList->InsertColumn(0, _T("AAA"), LVCFMT_LEFT, 100);
pList->InsertColumn(1, _T("BBB"), LVCFMT_LEFT, 100);
pList->InsertColumn(1, _T("CCC"), LVCFMT_LEFT, 100);
CString str;
for(int i=0; i<10; i++)
{
pList->InsertItem(i, _T(""));
str.Format(_T("%d - AAA"), i);
pList->SetItemText(i, 0, str);
str.Format(_T("%d - BBB"), i);
pList->SetItemText(i, 1, str);
str.Format(_T("%d - CCC"), i);
pList->SetItemText(i, 2, str);
}
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.