Solved

About CImageList

Posted on 2002-07-29
2
237 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

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
ORA-01403: no data found 43 111
Shell script to login to remote m/c and execute commands 10 78
fizzArray  challenge 1 109
I could not set window to top 4 42
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

756 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