• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 162
  • Last Modified:

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

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
AMuhsin
Asked:
AMuhsin
  • 2
1 Solution
 
migelCommented:
What Items do you mean? menu or simple static text into the dialog?

0
 
migelCommented:
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
 
sankar012898Commented:
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
 
shaigCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now