LONG lStyle = m_cListCtrl.SendMessage(LVM_GETEXTENDEDLISTVIEWSTYLE);
lStyle |= LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_HEADERDRAGDROP;
m_cListCtrl.SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, (LPARAM)lStyle);
// TODO: 在此添加额外的初始化代码
CRect rect;
m_cListCtrl.GetClientRect(&rect);
int nColInterval = rect.Width()/3;
m_cListCtrl.InsertColumn(0, _T("日期"), LVCFMT_CENTER, nColInterval);
m_cListCtrl.InsertColumn(1, _T("指数"), LVCFMT_CENTER, nColInterval);
m_cListCtrl.InsertColumn(2, _T("基数点"), LVCFMT_CENTER, nColInterval);
// Use the LV_ITEM structure to insert the items
LVITEM lvi;
CString strItem;
// Insert the first item
lvi.mask = LVIF_IMAGE | LVIF_TEXT;
strItem = "1990.12.19";
lvi.iItem = 0;
lvi.iSubItem = 0;
lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
//lvi.iImage = i%8; // There are 8 images in the image list
m_cListCtrl.InsertItem(&lvi);
// Set subitem 1
strItem.Format(_T("%.2f"), 95.79);
lvi.iSubItem =1;
lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
m_cListCtrl.SetItem(&lvi);
// Set subitem 2
strItem.Format(_T("%d"),2);
lvi.iSubItem =2;
lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
m_cListCtrl.SetItem(&lvi);
//第二个数据
lvi.mask = LVIF_IMAGE | LVIF_TEXT;
strItem = "1993.2.16";
lvi.iItem = 1;
lvi.iSubItem = 0;
lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
//lvi.iImage = i%8; // There are 8 images in the image list
m_cListCtrl.InsertItem(&lvi);
// Set subitem 1
strItem.Format(_T("%.2f"), 1558.98);
lvi.iSubItem =1;
lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
m_cListCtrl.SetItem(&lvi);
// Set subitem 2
strItem.Format(_T("%d"),550);
lvi.iSubItem =2;
lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
m_cListCtrl.SetItem(&lvi);