首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

CListCtrl怎么插入文字

2012-03-18 
CListCtrl如何插入文字?基于对话框我拉如了一个CListCtrl控件IDC_LIST1,设置为ICON属性,关联变量m_lcTest,

CListCtrl如何插入文字?
基于对话框我拉如了一个CListCtrl控件IDC_LIST1,设置为ICON属性,关联变量m_lcTest,再定义CImageList       m_image;


m_image.Create(50,50,ILC_COLOR8,0,0);
m_lcTest.SetImageList(&m_image,LVSIL_NORMAL);
m_lcTest.SetIconSpacing(70,70);
for(int   i=0;i <5;i++)
{
m_image.Add(&bitmap[i],RGB(0,0,0));
              m_lcTest.InsertItem(0,0,i);
}

我已成功的显示了5张bmp的图,我想在下一行中显示几个文字,但那些不属于某个icon`~就相当于QQ软件那更改头像的那些文字一样,什么 "推荐头像7个 "   "男士头像30个 "。。我就想插入那些文字。。我该如何实现?

[解决办法]
CListCtrl::SetItemText
BOOL SetItemText( int nItem, int nSubItem, LPTSTR lpszText );

Return Value

Nonzero if successful; otherwise zero.

Parameters

nItem

Index of the item whose text is to be set.

nSubItem

Index of the subitem, or zero to set the item label.

lpszText

Pointer to a string that contains the new item text.

Remarks

Changes the text of a list view item or subitem.


[解决办法]
那个是CTreeCtrl
不是list

热点排行