请问向listctrl中插入数据的函数是什么?给个例子也行
解决方案 »
- CSocket 发送数据的问题
- 我编写的SDI程序中,如何让CEditView中的文档在程序关闭时不弹出保存提示
- 关于同步运行
- [崩溃了!] VC 资源ID什么的一大堆错误 .谁进来帮下.
- 为啥串口通信特别慢?
- 一个奇怪的问题.
- 进程A把消息钩子安装到了进程B,按理说应该是过滤进程B的消息呀,为什么其他进程的消息也过滤了?奇怪哦~
- 美国CNN新闻网的又一个调查!!!!
- 怎样在vc++中使用高彩工具栏
- 我在MSDN中找不到CCommandLineInfo::FileNothing
- 编译的时候提示:Error spawning cl.exe 是什么意思?在线wait。。。
- 多线程问题,不会帮顶也有分。
InsertItem
SetItemText
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_clistctrl.3a3a.insertcolumn.aspCString strText;
int nColumnCount = pmyListCtrl->GetHeaderCtrl()->GetItemCount();// Insert 10 items in the list view control.
for (int i=0;i < 10;i++)
{
strText.Format(TEXT("item %d"), i); // Insert the item, select every other item.
pmyListCtrl->InsertItem(
LVIF_TEXT|LVIF_STATE, i, strText,
(i%2)==0 ? LVIS_SELECTED : 0, LVIS_SELECTED,
0, 0); // Initialize the text of the subitems.
for (int j=1;j < nColumnCount;j++)
{
strText.Format(TEXT("sub-item %d %d"), i, j);
pmyListCtrl->SetItemText(i, j, strText);
}
}