Solved

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

Posted on 1998-12-30
4
153 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Decoding 32 bit binary streams 6 37
Question regarding Copy/Paste 16 91
ASCII Non-Printable characters/codes and their HTML equivalents 6 106
Thin secure Windows 10 5 76
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

22 Experts available now in Live!

Get 1:1 Help Now