Solved

How to change the color of text in a listbox

Posted on 1998-08-24
6
237 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
why "." vs "->" 23 119
TTimer no longer functioning 7 85
I could not build boost code, 10 78
Error creating a new C++ project in ,net 20 21
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

896 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

13 Experts available now in Live!

Get 1:1 Help Now