Solved

Need some help with ImageList and CListCtrl

Posted on 2008-10-07
4
559 Views
Last Modified: 2013-11-20
Hello,
I would like to add an Icon to my CListCtrl.
With my code I can only add the Icon to the first column of each row.
I would like to add the Icon on other columns.
Please let me know.
500 poinst with a solution.
Best regards,
Thomas

CImageList m_image;
m_image.Create(32,32,ILC_COLOR16|ILC_MASK,1,1);
	 
	m_image.Add(AfxGetApp()->LoadIcon(IDI_ICON1));
	m_List.SetImageList(&m_image,LVSIL_SMALL);

Open in new window

0
Comment
Question by:tsp2002
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 22657087
Owner draw - I think that is your only solution.
You have to then draw the content of the 'cells' yourself.
0
 
LVL 19

Accepted Solution

by:
alb66 earned 250 total points
ID: 22657119
0
 
LVL 39

Assisted Solution

by:itsmeandnobodyelse
itsmeandnobodyelse earned 250 total points
ID: 22658755
In YourDialog::OnInitDialog you would do like

  DWORD exStyle = m_listCtrl.GetExtendedStyle();
  exStyle |= LVS_EX_SUBITEMIMAGES;
  m_listCtrl.SetExtendedStyle(exStyle );

To add subimages you would use the SetItem for example

   m_listCtrl.SetItem(item, column, LVIF_IMAGE, NULL, imageIdx, 0, 0, 0);
 
0
 

Author Closing Comment

by:tsp2002
ID: 31503726
LVS_EX_SUBITEMIMAGES....that works...thanks a lot
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Expand data scrubbing tool 13 36
sum67 challenge 35 128
lucky13 challenge 11 164
JQuery serialize and unserialize 8 262
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question