Solved

About CImageList

Posted on 2002-07-29
2
241 Views
Last Modified: 2013-11-20
hi friends
          i am using CImagelist in my application ,i am using this images in front of a tree items (create this imagelist in OnInitDialog() of a dialog which contains a tree)
& i want to change the color of a image(which is in the list) & in front of a particular treeitem according to my event...
   i am using SetItemImage(..) ,but it works only when i click on that item only...
how it is possible..(i want detail information..that how to create CImageList ..& how to perform this required task..)

bye
srinitin
0
Comment
Question by:srinitin
[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
2 Comments
 
LVL 1

Accepted Solution

by:
gurly earned 50 total points
ID: 7185142
Creating an image-list (based on icons):
     // creating the image list
     m_oImgList.Create(     16, // item width
                              16, // item height
                              TRUE, // flags
                              1, // initial items in the image list
                              1); // grow by
     // inserting items to the image list
     CWinApp* pApp = AfxGetApp();
     int nIcon1 = m_oImgList.Add(pApp->LoadIcon(IDI_ICON1));
     int nIcon2 = m_oImgList.Add(pApp->LoadIcon(IDI_ICON2));


To change the item image:
(Let's say you want to change the image to IDI_ICON2)
m_oTree.SetItemImage(hItem, nIcon2, nIcon2);

try invalidating the tree:
m_oTree.Invalidate();
0
 

Author Comment

by:srinitin
ID: 7187467
Thanks qurly...
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

739 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