稳定盈利的期货交易方法-量化趋势交易

alantop -专业量化投资者

爱好:量化投资,逆向工程,渗透
随笔 - 595, 文章 - 0, 评论 - 921, 引用 - 0
数据加载中……

ListCtrl的用法

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);

posted on 2008-07-12 13:02 AlanTop 阅读(626) 评论(0)  编辑 收藏 引用 所属分类: VC++


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理