Solved

how do you show items in different colours in a list box

Posted on 1998-12-30
4
154 Views
Last Modified: 2013-11-20
Simple text items, need to show items in different colours and treat each differently if pressed.
I know this is to do with owner drawn items but it is the how and the details that elude me.
No rush with this question answer any time would be nice if it is very clear and detailed. (e.g. clearly stating where each function will be placed).
0
Comment
Question by:AMuhsin
  • 2
4 Comments
 
LVL 12

Expert Comment

by:migel
ID: 1327021
What Items do you mean? menu or simple static text into the dialog?

0
 
LVL 12

Expert Comment

by:migel
ID: 1327022
sorry I haven`t keep in mind your question caption.
I think that Ownerdraw listbox will be enough to this task.
Just derive your class from the CListBox and override OnDrawItem and OnMeasureItem methods
0
 

Expert Comment

by:sankar012898
ID: 1327023
U have to create the Ur listbox with "OwnerDraw" option and
override the functions Migel mentioned . See the sample apps  in www.codeguru.com .

0
 
LVL 3

Accepted Solution

by:
shaig earned 50 total points
ID: 1327024
Been there not long ago.
I always preffer to use listctrl.
Custom draw is much easer then owner draw. Search for this in MSDN it is very simple, just what you need.

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

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.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

813 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now