Solved

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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 …
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

760 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

17 Experts available now in Live!

Get 1:1 Help Now