insert image into list control

Sep 26, 2010 at 4:59am
Hi, I am having a few problems with inserting images into my list control.
They dont seem to show up.
This is my code below and lParticipant is my list control.

Is it also possible to insert images into sub items?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void CTabDlg::addParticipant(CString strAdd)
{
	
	int nItem;
	CImageList imgList;
	imgList.Create(16, 16,ILC_COLOR8, 0, 0);
	CBitmap bm;
	bm.LoadBitmap(IDB_BITMAP1);
	imgList.Add(&bm, RGB(255, 255, 0));
	//lParticipant.SetImageList(&imgList, LVS_SMALLICON);


	LVITEMA imgText;
	nItem=lParticipant.InsertItem(participantIndex, strAdd,0);
	imgText.iItem=nItem;
	lParticipant.SetItemText(nItem,1,"aa");
	lParticipant.SetItem(&imgText);
	participantIndex++;


}
Sep 26, 2010 at 5:01pm
What software are you using for compile ?
Borland C++ ?
Dev-C++ ?
Code Blocks ?
Visual Studio 2008 ?
Visual Studio 2010 ?
... ??

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

and what do you intend to use the program for ?
Sep 26, 2010 at 6:03pm
How is any of that relevant? He just wants to know if he can add icons to lists and context menus, and how to do so.
Sep 27, 2010 at 11:36am
i am using visual studio 2008
Topic archived. No new replies allowed.