'AddString' : is not a member of 'CListCtrl'
答案:1 悬赏:40 手机版
解决时间 2021-02-14 22:43
- 提问者网友:沦陷
- 2021-02-14 09:33
如题,我用MFC的ListBox想往里添加内容,编译时却提示这个
最佳答案
- 五星知识达人网友:渊鱼
- 2021-02-14 09:58
CComboBox才有AddString,CListCtrl添加内容是InsertColumn和InsertItem:
pLst->InsertColumn(0,"序号");
pLst->InsertColumn(1, "姓名");
pLst->InsertColumn(2, "性别");
int iIndex = pLst->GetItemCount();
pLst->InsertItem(iIndex,"1");
pLst->SetItemText(iIndex,0,"1");
pLst->SetItemText(iIndex,1,"王");
pLst->SetItemText(iIndex++,2,"女");
pLst->InsertColumn(0,"序号");
pLst->InsertColumn(1, "姓名");
pLst->InsertColumn(2, "性别");
int iIndex = pLst->GetItemCount();
pLst->InsertItem(iIndex,"1");
pLst->SetItemText(iIndex,0,"1");
pLst->SetItemText(iIndex,1,"王");
pLst->SetItemText(iIndex++,2,"女");
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯