32*32 icon in CListCtrl 
Author Message
 32*32 icon in CListCtrl

Hi all,

I have a simple dialog window with a LVS_REPORT style Listview control on
it. I wish to insert 32*32 images in some of the cells but i m not
successful as yet.

Here is the code.. could someone pl let me know whats wrong am i doing?

//declaration in .h file
CListCtrl m_List;
CImageList m_ImageList;

//Imagelist creation
m_ImageList.Create(32,32,ILC_COLOR24 ,5,0);
m_ImageList.Add(AfxGetApp()->LoadIcon(IDI_CALENDAR));
m_ImageList.Add(AfxGetApp()->LoadIcon(IDI_CONTACTS));
m_ImageList.Add(AfxGetApp()->LoadIcon(IDI_OUTLOOK2PHONE));
m_ImageList.Add(AfxGetApp()->LoadIcon(IDI_PHONE2OUTLOOK));
m_ImageList.Add(AfxGetApp()->LoadIcon(IDI_SYNC));

//List control initialization
m_List.SetImageList(&m_ImageList,LVSIL_NORMAL);

m_List.InsertColumn(0,"SELECTION");
m_List.InsertColumn(1,"ICON");
m_List.InsertColumn(2,"APP");
m_List.InsertColumn(3,"TRANSFER_TYPE");
m_List.InsertColumn(4,"OUTLOOK");
m_List.InsertColumn(5,"SYNC_TYPE");
m_List.SetColumnWidth(0,100 );
m_List.SetColumnWidth(1,100);
m_List.SetColumnWidth(2,100);
m_List.SetColumnWidth(3,32);
m_List.SetColumnWidth(4,100);
m_List.SetColumnWidth(5,200);

//sub items

CString strItem;
strItem="Deepesh";
LVITEM lvi;
lvi.mask = LVIF_IMAGE;// | LVIF_TEXT;
lvi.iItem = 0;
lvi.iSubItem = 1;
lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
lvi.iImage = CONTACT_ICON;
m_List.InsertItem(&lvi);
strItem="Dhapola";
lvi.mask = LVIF_TEXT;
lvi.iSubItem =2;
lvi.pszText = (LPTSTR)(LPCTSTR)(strItem);
m_List.SetItem(&lvi);

tx in adv
Deepesh



Sun, 18 Dec 2005 01:59:01 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. deleting the 32 x 32 icon from an .ico file

2. signed 64bit (aka 32:32 bit) pseudo division and multiplication

3. 32-bit parallel crc-32 gen/chk with padding bytes

4. 32-bit VC 2.2 DLLs with 32-bit VB4

5. top 32 bits of 64-bit product of two 32-bit integers

6. Linking 32 bit VC++4.2 DLLs with VB4.0 32 bit

7. 32 bit Icons and C# VS.net (24 bit + 8 bit alpha)

8. While Loading an Icon From an Icon File Can We Explicitly Specify Which Icon (32 Bit or 16 bit or Size 16X16 or 32X32) To Load

9. Please, need help: VC++ (32 BITS) Function -> VB 4 (32 bits)

10. how to display a 32 bits bitmap(red,green,blue+alpha:8+8+8+8=32)

11. How to create a ComboBox in 32*32 flat toolbar?

12. really not time_t (32 bits) on MFC on .NET

 

 
Powered by phpBB® Forum Software