Solved

How to change the color of text in a listbox

Posted on 1998-08-24
6
235 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
  • 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

758 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

20 Experts available now in Live!

Get 1:1 Help Now