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
Solved

List Box color

Posted on 2004-04-14
2
258 Views
Last Modified: 2013-11-20
Hi!

Check next code:

  CListBox   *pCLB;
  char       szB [256];

  pCLB = (CListBox *) GetDlgItem (IDC_TESTPLACE_LIST);  // get List-Box
  sprintf (szB, "%s", MessageText);
  if (szB[0] != 0) {
    pCLB->InsertString(-1, &szB[0]);
  }

Text is now displayed only in black color. How can I set different text colors in CListBox?

Thanks
Sasa
0
Comment
Question by:sasabunetic
2 Comments
 
LVL 4

Expert Comment

by:caner_elci
ID: 10822153
You have to use owner draw items.. Set ListBox's OWNERDRAW style and use CListBox::MeasureItem, CListBox::DrawItem pair to draw your own items.. So you can set any color or font in your list box..
A featured sample can be found at : http://www.codeproject.com/combobox/xlistbox.asp
0
 
LVL 14

Accepted Solution

by:
Daniel Junges earned 100 total points
ID: 10822259
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
repeatEnd java challenge 42 85
Expand macro to ask for filename column 8 37
unable to delete all specified values regedit 38 551
string initialization in java 11 115
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

860 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