Solved

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

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

 Watch the Recording: Learning MySQL 5.7

MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

617 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