?
Solved

About CImageList

Posted on 2002-07-29
2
Medium Priority
?
243 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 150 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

718 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