请问怎么在listcontrol控件中指定的某行某列插入一项数据。
解决方案 »
- xp下可以实现windows7的透明效果吗?
- CStdioFile类的ReadString函数读入访问冲突
- 请教如何设置CListView的焦点项?
- 我在VC里面使用Vector等容器时,总是出现一些警告信息。那位遇到过。帮个忙看看。
- vc数据库工程安装程序的建立?
- 如何在OnKeyDown 中处理Ctrl+Page Down 消息?
- 硬盘发生写保护
- 有没有win2000 server下的网络监控程序,类似win98下的netxray,可以截IP包的
- 如何判断网页加载完成,请大家来讨论
- 关于使用cursor的困惑
- 利用CRecordset成员GetFieldValue出现的一个很怪的问题
- Assert问题
m_listctrl.SetItemText(i,n,"text");//设置第i行的第n列内容为text
m_list.InsertColumn( 1, "NAME", LVCFMT_LEFT, 50 );
m_list.InsertColumn( 2, "SEX", LVCFMT_LEFT, 70 );
m_list.InsertColumn( 3, "TEL", LVCFMT_LEFT, 90); CString strtemp;
for(int i=0; i < 2; i++)
{
strtemp.Format("%d", i+1);
int nRow = m_list.InsertItem(i, strtemp);
strtemp.Format("ID%d", i+1);
m_list.SetItemText(nRow, 1, strtemp);
strtemp.Format("NAME%d", i+1);
m_list.SetItemText(nRow, 2, strtemp);
strtemp.Format("address%d", i+1);
m_list.SetItemText(nRow, 3, strtemp);
}
m_listctrl.DeleteColumn(1);
m_listctrl.DeleteColumn(2);
m_listctrl.DeleteColumn(3);
m_listctrl.DeleteColumn(4);
m_listctrl.DeleteColumn(5);
m_listctrl.DeleteColumn(6);
m_listctrl.DeleteColumn(7); m_listctrl.InsertColumn(0, "index", LVCFMT_LEFT, 100, 0);
m_listctrl.InsertColumn(1, "accountnum", LVCFMT_LEFT, 100, 1);
m_listctrl.InsertColumn(2, "channelname", LVCFMT_LEFT, 100, 2);
m_listctrl.InsertColumn(3, "year", LVCFMT_LEFT, 50, 3);
m_listctrl.InsertColumn(4, "month", LVCFMT_LEFT, 50, 4);
m_listctrl.InsertColumn(5, "day", LVCFMT_LEFT, 50, 5);
m_listctrl.InsertColumn(6, "hour", LVCFMT_LEFT, 50, 6);
m_listctrl.InsertColumn(7, "minute", LVCFMT_LEFT, 50, 7); m_pSet->MoveFirst();
for(long i=0; !m_pSet->IsEOF(); i++)
{
m_listctrl.InsertItem(i, m_pSet->m_index);
m_listctrl.SetItemText(i, 1, m_pSet->m_account);
m_listctrl.SetItemText(i, 2, m_pSet->m_channel);
m_listctrl.SetItemText(i, 3, m_pSet->m_year);
m_listctrl.SetItemText(i, 4, m_pSet->m_month);
m_listctrl.SetItemText(i, 5, m_pSet->m_day);
m_listctrl.SetItemText(i, 6, m_pSet->m_hour);
m_listctrl.SetItemText(i, 7, m_pSet->m_minute); m_pSet->MoveNext();
}