Solved

How to change the color of text in a listbox

Posted on 1998-08-24
6
248 Views
Last Modified: 2010-04-10
How can i change the color of individual lines of text in a listbox
i'm using visual c++ 5
Thanx in aDvance
0
Comment
Question by:mwebster
[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
  • 4
  • 2
6 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 1171146
If you want all the text to be the same color, catch the WM_CTLCOLORLISTBOX message (or override CWnd::OnCtlColor for MFC). If you want each line to have different color, create an  owner-draw list box (override CListBox::OnDrawItem, ...).
0
 

Author Comment

by:mwebster
ID: 1171147
do you have any sample code for an owner drawn listbox
thanx again
0
 
LVL 23

Expert Comment

by:chensu
ID: 1171148
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Expert Comment

by:chensu
ID: 1171149
0
 

Author Comment

by:mwebster
ID: 1171150
thanx again but the second url does not exist and do you have anything in using visual c++.
0
 
LVL 23

Expert Comment

by:chensu
ID: 1171151
The second URL is correct. Try this
http://www.codeguru.com/show.cgi?controls=/controls/tab_checklistbox.shtml

Or go to http://www.codeguru.com, click "other controls" on the left navigation bar, there are some list box related articles.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

688 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